This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for parsing schema definition
- Loading branch information
Showing
27 changed files
with
1,278 additions
and
198 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\FieldDefinitionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class FieldDefinitionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new FieldDefinitionNode([ | ||
'description' => $this->buildOne($ast, 'description'), | ||
'name' => $this->buildOne($ast, 'name'), | ||
'arguments' => $this->buildMany($ast, 'arguments'), | ||
'type' => $this->buildOne($ast, 'type'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::FIELD_DEFINITION; | ||
} | ||
} |
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 Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\ObjectTypeDefinitionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class ObjectTypeDefinitionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new ObjectTypeDefinitionNode([ | ||
'description' => $this->buildOne($ast, 'description'), | ||
'name' => $this->buildOne($ast, 'name'), | ||
'interfaces' => $this->buildMany($ast, 'interfaces'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'fields' => $this->buildMany($ast, 'fields'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::OBJECT_TYPE_DEFINITION; | ||
} | ||
} |
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
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
Oops, something went wrong.