-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add description and source field name properties to MagicField and So…
…urceField annotations (#402) * Add description property to MagicField and SourceField annotations * Add source field name property for MagicField and SourceField annotations * Update docs for MagicField and SourceField Co-authored-by: Michael Vostrikov <[email protected]>
- Loading branch information
1 parent
ba3637c
commit 21bc850
Showing
13 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace TheCodingMachine\GraphQLite\Fixtures; | ||
|
||
use Exception; | ||
|
||
class TestSourceName | ||
{ | ||
/** @var string */ | ||
private $foo; | ||
|
||
/** @var string */ | ||
private $bar; | ||
|
||
public function __construct(string $foo, string $bar) | ||
{ | ||
$this->foo = $foo; | ||
$this->bar = $bar; | ||
} | ||
|
||
public function __get($name) | ||
{ | ||
if ($name !== 'foo') { | ||
throw new Exception('Unknown property: ' . $name); | ||
} | ||
|
||
return $this->$name; | ||
} | ||
|
||
public function getBar(): string | ||
{ | ||
return $this->bar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace TheCodingMachine\GraphQLite\Fixtures; | ||
|
||
use TheCodingMachine\GraphQLite\Fixtures\TestSourceName; | ||
use TheCodingMachine\GraphQLite\Annotations\MagicField; | ||
use TheCodingMachine\GraphQLite\Annotations\SourceField; | ||
use TheCodingMachine\GraphQLite\Annotations\Type; | ||
|
||
/** | ||
* @Type(class=TestSourceName::class) | ||
* @MagicField(name="foo2", outputType="String!", sourceName="foo") | ||
* @SourceField(name="bar2", sourceName="bar") | ||
*/ | ||
class TestSourceNameType | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters