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.
- Loading branch information
Showing
46 changed files
with
929 additions
and
225 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ | |
|
||
class SyntaxError extends GraphQLError | ||
{ | ||
|
||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\DirectiveDefinitionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class DirectiveDefinitionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new DirectiveDefinitionNode([ | ||
'description' => $this->buildOne($ast, 'description'), | ||
'name' => $this->buildOne($ast, 'name'), | ||
'arguments' => $this->buildMany($ast, 'arguments'), | ||
'locations' => $this->buildMany($ast, 'locations'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::DIRECTIVE_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\EnumTypeExtensionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class EnumTypeExtensionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new EnumTypeExtensionNode([ | ||
'name' => $this->buildOne($ast, 'name'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'values' => $this->buildMany($ast, 'values'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::ENUM_TYPE_EXTENSION; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Language/AST/Builder/InputObjectTypeExtensionBuilder.php
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,32 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\InputObjectTypeExtensionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class InputObjectTypeExtensionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new InputObjectTypeExtensionNode([ | ||
'name' => $this->buildOne($ast, 'name'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'fields' => $this->buildMany($ast, 'fields'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::INPUT_OBJECT_TYPE_EXTENSION; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Language/AST/Builder/InterfaceTypeExtensionBuilder.php
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,32 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\InterfaceTypeExtensionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class InterfaceTypeExtensionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new InterfaceTypeExtensionNode([ | ||
'name' => $this->buildOne($ast, 'name'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'fields' => $this->buildMany($ast, 'fields'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::INTERFACE_TYPE_EXTENSION; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Language/AST/Builder/OperationTypeDefinitionBuilder.php
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,31 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\OperationTypeDefinitionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class OperationTypeDefinitionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new OperationTypeDefinitionNode([ | ||
'operation' => $this->get($ast, 'operation'), | ||
'type' => $this->buildOne($ast, 'type'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::OPERATION_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\ScalarTypeDefinitionNode; | ||
use Digia\GraphQL\Language\AST\Node\ScalarTypeExtensionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class ScalarTypeExtensionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new ScalarTypeExtensionNode([ | ||
'name' => $this->buildOne($ast, 'name'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::SCALAR_TYPE_EXTENSION; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\SchemaDefinitionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class SchemaDefinitionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new SchemaDefinitionNode([ | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'operationTypes' => $this->buildMany($ast, 'operationTypes'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::SCHEMA_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Digia\GraphQL\Language\AST\Builder; | ||
|
||
use Digia\GraphQL\Language\AST\Node\Contract\NodeInterface; | ||
use Digia\GraphQL\Language\AST\Node\UnionTypeExtensionNode; | ||
use Digia\GraphQL\Language\AST\NodeKindEnum; | ||
|
||
class UnionTypeExtensionBuilder extends AbstractBuilder | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function build(array $ast): NodeInterface | ||
{ | ||
return new UnionTypeExtensionNode([ | ||
'name' => $this->buildOne($ast, 'name'), | ||
'directives' => $this->buildMany($ast, 'directives'), | ||
'types' => $this->buildMany($ast, 'types'), | ||
'location' => $this->createLocation($ast), | ||
]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function supportsKind(string $kind): bool | ||
{ | ||
return $kind === NodeKindEnum::UNION_TYPE_EXTENSION; | ||
} | ||
} |
Oops, something went wrong.