Showing preview only (1,742K chars total). Download the full file or copy to clipboard to get everything.
Repository: digiaonline/graphql-php
Branch: main
Commit: 0397520e82e7
Files: 414
Total size: 1.6 MB
Directory structure:
gitextract_sov667i9/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ └── test.yml
├── .gitignore
├── .idea/
│ ├── codeStyles/
│ │ ├── Project.xml
│ │ └── codeStyleConfig.xml
│ ├── graphql-php.iml
│ ├── inspectionProfiles/
│ │ └── Project_Default.xml
│ ├── modules.xml
│ ├── php.xml
│ └── vcs.xml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── composer.json
├── phpunit.xml.dist
├── src/
│ ├── Error/
│ │ ├── AbstractException.php
│ │ ├── FileNotFoundException.php
│ │ ├── GraphQLException.php
│ │ ├── Handler/
│ │ │ ├── AbstractErrorMiddleware.php
│ │ │ ├── CallableMiddleware.php
│ │ │ ├── ErrorHandler.php
│ │ │ ├── ErrorHandlerInterface.php
│ │ │ └── ErrorMiddlewareInterface.php
│ │ ├── InvalidTypeException.php
│ │ ├── InvariantException.php
│ │ └── helpers.php
│ ├── Execution/
│ │ ├── CoercedValue.php
│ │ ├── Execution.php
│ │ ├── ExecutionContext.php
│ │ ├── ExecutionException.php
│ │ ├── ExecutionInterface.php
│ │ ├── ExecutionProvider.php
│ │ ├── ExecutionResult.php
│ │ ├── InvalidReturnTypeException.php
│ │ ├── Path.php
│ │ ├── ResolveInfo.php
│ │ ├── Strategy/
│ │ │ ├── AbstractExecutionStrategy.php
│ │ │ ├── ExecutionStrategyInterface.php
│ │ │ ├── FieldCollector.php
│ │ │ ├── ParallelExecutionStrategy.php
│ │ │ └── SerialExecutionStrategy.php
│ │ ├── UndefinedFieldException.php
│ │ └── ValuesResolver.php
│ ├── GraphQL.php
│ ├── Language/
│ │ ├── DirectiveLocationEnum.php
│ │ ├── FileSourceBuilder.php
│ │ ├── KeywordEnum.php
│ │ ├── LanguageException.php
│ │ ├── LanguageProvider.php
│ │ ├── Lexer.php
│ │ ├── LexerInterface.php
│ │ ├── Location.php
│ │ ├── MultiFileSourceBuilder.php
│ │ ├── Node/
│ │ │ ├── ASTNodeAwareInterface.php
│ │ │ ├── ASTNodeTrait.php
│ │ │ ├── AbstractNode.php
│ │ │ ├── AliasTrait.php
│ │ │ ├── ArgumentNode.php
│ │ │ ├── ArgumentsAwareInterface.php
│ │ │ ├── ArgumentsTrait.php
│ │ │ ├── BooleanValueNode.php
│ │ │ ├── DefaultValueTrait.php
│ │ │ ├── DefinitionNodeInterface.php
│ │ │ ├── DescriptionTrait.php
│ │ │ ├── DirectiveDefinitionNode.php
│ │ │ ├── DirectiveNode.php
│ │ │ ├── DirectivesAwareInterface.php
│ │ │ ├── DirectivesTrait.php
│ │ │ ├── DocumentNode.php
│ │ │ ├── EnumTypeDefinitionNode.php
│ │ │ ├── EnumTypeExtensionNode.php
│ │ │ ├── EnumValueDefinitionNode.php
│ │ │ ├── EnumValueNode.php
│ │ │ ├── EnumValuesTrait.php
│ │ │ ├── ExecutableDefinitionNodeInterface.php
│ │ │ ├── FieldDefinitionNode.php
│ │ │ ├── FieldNode.php
│ │ │ ├── FieldsTrait.php
│ │ │ ├── FloatValueNode.php
│ │ │ ├── FragmentDefinitionNode.php
│ │ │ ├── FragmentNodeInterface.php
│ │ │ ├── FragmentSpreadNode.php
│ │ │ ├── InlineFragmentNode.php
│ │ │ ├── InputArgumentsTrait.php
│ │ │ ├── InputFieldsTrait.php
│ │ │ ├── InputObjectTypeDefinitionNode.php
│ │ │ ├── InputObjectTypeExtensionNode.php
│ │ │ ├── InputValueDefinitionNode.php
│ │ │ ├── IntValueNode.php
│ │ │ ├── InterfaceTypeDefinitionNode.php
│ │ │ ├── InterfaceTypeExtensionNode.php
│ │ │ ├── InterfacesTrait.php
│ │ │ ├── ListTypeNode.php
│ │ │ ├── ListValueNode.php
│ │ │ ├── NameAwareInterface.php
│ │ │ ├── NameNode.php
│ │ │ ├── NameTrait.php
│ │ │ ├── NamedTypeNode.php
│ │ │ ├── NamedTypeNodeInterface.php
│ │ │ ├── NodeInterface.php
│ │ │ ├── NodeKindEnum.php
│ │ │ ├── NonNullTypeNode.php
│ │ │ ├── NullValueNode.php
│ │ │ ├── ObjectFieldNode.php
│ │ │ ├── ObjectTypeDefinitionNode.php
│ │ │ ├── ObjectTypeExtensionNode.php
│ │ │ ├── ObjectValueNode.php
│ │ │ ├── OperationDefinitionNode.php
│ │ │ ├── OperationTypeDefinitionNode.php
│ │ │ ├── ScalarTypeDefinitionNode.php
│ │ │ ├── ScalarTypeExtensionNode.php
│ │ │ ├── SchemaDefinitionNode.php
│ │ │ ├── SchemaExtensionNode.php
│ │ │ ├── SelectionNodeInterface.php
│ │ │ ├── SelectionSetAwareInterface.php
│ │ │ ├── SelectionSetNode.php
│ │ │ ├── SelectionSetTrait.php
│ │ │ ├── StringValueNode.php
│ │ │ ├── TypeConditionTrait.php
│ │ │ ├── TypeNodeInterface.php
│ │ │ ├── TypeSystemDefinitionNodeInterface.php
│ │ │ ├── TypeSystemExtensionNodeInterface.php
│ │ │ ├── TypeTrait.php
│ │ │ ├── TypesTrait.php
│ │ │ ├── UnionTypeDefinitionNode.php
│ │ │ ├── UnionTypeExtensionNode.php
│ │ │ ├── ValueAwareInterface.php
│ │ │ ├── ValueLiteralTrait.php
│ │ │ ├── ValueNodeInterface.php
│ │ │ ├── ValueTrait.php
│ │ │ ├── VariableDefinitionNode.php
│ │ │ ├── VariableDefinitionsAwareInterface.php
│ │ │ ├── VariableDefinitionsTrait.php
│ │ │ └── VariableNode.php
│ │ ├── NodeBuilder.php
│ │ ├── NodeBuilderInterface.php
│ │ ├── NodePrinter.php
│ │ ├── NodePrinterInterface.php
│ │ ├── Parser.php
│ │ ├── ParserInterface.php
│ │ ├── PrintException.php
│ │ ├── Source.php
│ │ ├── SourceBuilderInterface.php
│ │ ├── SourceLocation.php
│ │ ├── StringSourceBuilder.php
│ │ ├── SyntaxErrorException.php
│ │ ├── Token.php
│ │ ├── TokenKindEnum.php
│ │ ├── Visitor/
│ │ │ ├── ParallelVisitor.php
│ │ │ ├── SpecificKindVisitor.php
│ │ │ ├── TypeInfoVisitor.php
│ │ │ ├── Visitor.php
│ │ │ ├── VisitorBreak.php
│ │ │ ├── VisitorInfo.php
│ │ │ ├── VisitorInterface.php
│ │ │ └── VisitorResult.php
│ │ ├── blockStringValue.php
│ │ └── utils.php
│ ├── Schema/
│ │ ├── Building/
│ │ │ ├── BuildInfo.php
│ │ │ ├── BuildingContext.php
│ │ │ ├── BuildingContextInterface.php
│ │ │ ├── SchemaBuilder.php
│ │ │ ├── SchemaBuilderInterface.php
│ │ │ ├── SchemaBuildingException.php
│ │ │ └── SchemaBuildingProvider.php
│ │ ├── DefinitionBuilder.php
│ │ ├── DefinitionBuilderInterface.php
│ │ ├── DefinitionInterface.php
│ │ ├── DefinitionPrinter.php
│ │ ├── DefinitionPrinterInterface.php
│ │ ├── Extension/
│ │ │ ├── ExtendInfo.php
│ │ │ ├── ExtensionContext.php
│ │ │ ├── ExtensionContextInterface.php
│ │ │ ├── SchemaExtender.php
│ │ │ ├── SchemaExtenderInterface.php
│ │ │ ├── SchemaExtensionException.php
│ │ │ └── SchemaExtensionProvider.php
│ │ ├── Resolver/
│ │ │ ├── AbstractFieldResolver.php
│ │ │ ├── AbstractTypeResolver.php
│ │ │ ├── ResolverCollectionInterface.php
│ │ │ ├── ResolverInterface.php
│ │ │ ├── ResolverMap.php
│ │ │ ├── ResolverMiddlewareInterface.php
│ │ │ ├── ResolverRegistry.php
│ │ │ ├── ResolverRegistryInterface.php
│ │ │ └── ResolverTrait.php
│ │ ├── Schema.php
│ │ ├── Validation/
│ │ │ ├── Rule/
│ │ │ │ ├── AbstractRule.php
│ │ │ │ ├── DirectivesRule.php
│ │ │ │ ├── RootTypesRule.php
│ │ │ │ ├── RuleInterface.php
│ │ │ │ ├── SupportedRules.php
│ │ │ │ └── TypesRule.php
│ │ │ ├── SchemaValidationException.php
│ │ │ ├── SchemaValidationProvider.php
│ │ │ ├── SchemaValidator.php
│ │ │ ├── SchemaValidatorInterface.php
│ │ │ ├── ValidationContext.php
│ │ │ └── ValidationContextInterface.php
│ │ └── utils.php
│ ├── Type/
│ │ ├── Coercer/
│ │ │ ├── AbstractCoercer.php
│ │ │ ├── BooleanCoercer.php
│ │ │ ├── CoercerInterface.php
│ │ │ ├── CoercingException.php
│ │ │ ├── FloatCoercer.php
│ │ │ ├── IntCoercer.php
│ │ │ └── StringCoercer.php
│ │ ├── CoercerProvider.php
│ │ ├── Definition/
│ │ │ ├── AbstractTypeInterface.php
│ │ │ ├── Argument.php
│ │ │ ├── ArgumentsAwareInterface.php
│ │ │ ├── ArgumentsTrait.php
│ │ │ ├── CompositeTypeInterface.php
│ │ │ ├── DefaultValue.php
│ │ │ ├── DefaultValueTrait.php
│ │ │ ├── DeprecationAwareInterface.php
│ │ │ ├── DeprecationTrait.php
│ │ │ ├── DescriptionAwareInterface.php
│ │ │ ├── DescriptionTrait.php
│ │ │ ├── Directive.php
│ │ │ ├── EnumType.php
│ │ │ ├── EnumValue.php
│ │ │ ├── ExtensionASTNodesTrait.php
│ │ │ ├── Field.php
│ │ │ ├── FieldInterface.php
│ │ │ ├── FieldsAwareInterface.php
│ │ │ ├── FieldsTrait.php
│ │ │ ├── InputField.php
│ │ │ ├── InputObjectType.php
│ │ │ ├── InputTypeInterface.php
│ │ │ ├── InputValueInterface.php
│ │ │ ├── InterfaceType.php
│ │ │ ├── LeafTypeInterface.php
│ │ │ ├── ListType.php
│ │ │ ├── NameTrait.php
│ │ │ ├── NamedTypeInterface.php
│ │ │ ├── NonNullType.php
│ │ │ ├── ObjectType.php
│ │ │ ├── OfTypeTrait.php
│ │ │ ├── OutputTypeInterface.php
│ │ │ ├── ResolveTrait.php
│ │ │ ├── ResolveTypeTrait.php
│ │ │ ├── ScalarType.php
│ │ │ ├── SerializableTypeInterface.php
│ │ │ ├── SpecifiedDirectiveEnum.php
│ │ │ ├── TypeInterface.php
│ │ │ ├── TypeNameEnum.php
│ │ │ ├── TypeTrait.php
│ │ │ ├── UnionType.php
│ │ │ ├── ValueTrait.php
│ │ │ └── WrappingTypeInterface.php
│ │ ├── DirectivesProvider.php
│ │ ├── IntrospectionProvider.php
│ │ ├── ScalarTypesProvider.php
│ │ ├── TypeKindEnum.php
│ │ ├── definition.php
│ │ ├── directives.php
│ │ ├── introspection.php
│ │ └── scalars.php
│ ├── Util/
│ │ ├── AbstractEnum.php
│ │ ├── ArrayToJsonTrait.php
│ │ ├── ConversionException.php
│ │ ├── NameHelper.php
│ │ ├── NodeComparator.php
│ │ ├── SerializationInterface.php
│ │ ├── TypeASTConverter.php
│ │ ├── TypeHelper.php
│ │ ├── TypeInfo.php
│ │ ├── ValueASTConverter.php
│ │ ├── ValueConverter.php
│ │ ├── ValueHelper.php
│ │ └── utils.php
│ ├── Validation/
│ │ ├── Conflict/
│ │ │ ├── ComparisonContext.php
│ │ │ ├── Conflict.php
│ │ │ ├── ConflictFinder.php
│ │ │ ├── FieldContext.php
│ │ │ └── PairSet.php
│ │ ├── Rule/
│ │ │ ├── AbstractRule.php
│ │ │ ├── ExecutableDefinitionsRule.php
│ │ │ ├── FieldOnCorrectTypeRule.php
│ │ │ ├── FragmentsOnCompositeTypesRule.php
│ │ │ ├── KnownArgumentNamesRule.php
│ │ │ ├── KnownDirectivesRule.php
│ │ │ ├── KnownFragmentNamesRule.php
│ │ │ ├── KnownTypeNamesRule.php
│ │ │ ├── LoneAnonymousOperationRule.php
│ │ │ ├── NoFragmentCyclesRule.php
│ │ │ ├── NoUndefinedVariablesRule.php
│ │ │ ├── NoUnusedFragmentsRule.php
│ │ │ ├── NoUnusedVariablesRule.php
│ │ │ ├── OverlappingFieldsCanBeMergedRule.php
│ │ │ ├── PossibleFragmentSpreadsRule.php
│ │ │ ├── ProvidedRequiredArgumentsRule.php
│ │ │ ├── RuleInterface.php
│ │ │ ├── ScalarLeafsRule.php
│ │ │ ├── SingleFieldSubscriptionsRule.php
│ │ │ ├── SupportedRules.php
│ │ │ ├── UniqueArgumentNamesRule.php
│ │ │ ├── UniqueDirectivesPerLocationRule.php
│ │ │ ├── UniqueFragmentNamesRule.php
│ │ │ ├── UniqueInputFieldNamesRule.php
│ │ │ ├── UniqueOperationNamesRule.php
│ │ │ ├── UniqueVariableNamesRule.php
│ │ │ ├── ValuesOfCorrectTypeRule.php
│ │ │ ├── VariablesAreInputTypesRule.php
│ │ │ ├── VariablesDefaultValueAllowedRule.php
│ │ │ └── VariablesInAllowedPositionRule.php
│ │ ├── RulesProvider.php
│ │ ├── ValidationContext.php
│ │ ├── ValidationContextAwareTrait.php
│ │ ├── ValidationContextInterface.php
│ │ ├── ValidationException.php
│ │ ├── ValidationExceptionInterface.php
│ │ ├── ValidationProvider.php
│ │ ├── Validator.php
│ │ ├── ValidatorInterface.php
│ │ └── messages.php
│ └── api.php
└── tests/
├── Functional/
│ ├── Execution/
│ │ ├── AbstractPromiseTest.php
│ │ ├── AbstractTest.php
│ │ ├── DeferredResolverTest.php
│ │ ├── DirectivesTest.php
│ │ ├── ExecutionTest.php
│ │ ├── ListTest.php
│ │ ├── MutationTest.php
│ │ ├── NonNullTest.php
│ │ ├── ResolveTest.php
│ │ ├── SchemaTest.php
│ │ ├── UnionInterfaceTest.php
│ │ ├── ValuesResolverTest.php
│ │ ├── VariablesTest.php
│ │ └── testClasses.php
│ ├── IntrospectionTest.php
│ ├── Language/
│ │ ├── FileSourceBuilderTest.php
│ │ ├── MultiFileSourceBuilderTest.php
│ │ ├── ParserTest.php
│ │ ├── SchemaParserTest.php
│ │ ├── SchemaPrinterTest.php
│ │ ├── StringSourceBuilderTest.php
│ │ ├── VisitorTest.php
│ │ ├── kitchen-sink.graphql
│ │ └── schema-kitchen-sink.graphqls
│ ├── QueryTest.php
│ ├── Schema/
│ │ ├── BuildingTest.php
│ │ ├── DefinitionPrinterTest.php
│ │ ├── ExtensionTest.php
│ │ ├── SchemaBuilderTest.php
│ │ ├── SchemaTest.php
│ │ └── ValidationTest.php
│ ├── Type/
│ │ ├── DefinitionTest.php
│ │ ├── EnumTypeTest.php
│ │ ├── IntrospectionTest.php
│ │ ├── PredicateTest.php
│ │ ├── SerializationTest.php
│ │ └── introspection.graphql
│ ├── Validation/
│ │ ├── MessagesTest.php
│ │ ├── Rule/
│ │ │ ├── ExecutableDefinitionsRuleTest.php
│ │ │ ├── FieldOnCorrectTypeRuleTest.php
│ │ │ ├── FragmentsOnCompositeTypesRuleTest.php
│ │ │ ├── KnownArgumentNamesRuleTest.php
│ │ │ ├── KnownDirectivesRuleTest.php
│ │ │ ├── KnownFragmentNamesRuleTest.php
│ │ │ ├── KnownTypeNamesRuleTest.php
│ │ │ ├── LoneAnonymousOperationRuleTest.php
│ │ │ ├── NoFragmentCyclesRuleTest.php
│ │ │ ├── NoUndefinedVariablesRuleTest.php
│ │ │ ├── NoUnusedFragmentsRuleTest.php
│ │ │ ├── NoUnusedVariablesRuleTest.php
│ │ │ ├── OverlappingFieldsCanBeMergedRuleTest.php
│ │ │ ├── PossibleFragmentSpreadsRuleTest.php
│ │ │ ├── ProvidedRequiredArgumentsRuleTest.php
│ │ │ ├── RuleTestCase.php
│ │ │ ├── ScalarLeafsRuleTest.php
│ │ │ ├── SingleFieldSubscriptionsRuleTest.php
│ │ │ ├── UniqueArgumentNamesRuleTest.php
│ │ │ ├── UniqueDirectivesPerLocationRuleTest.php
│ │ │ ├── UniqueFragmentNamesRuleTest.php
│ │ │ ├── UniqueInputFieldNamesRuleTest.php
│ │ │ ├── UniqueOperationNamesRuleTest.php
│ │ │ ├── UniqueVariableNamesRuleTest.php
│ │ │ ├── ValuesOfCorrectTypeRuleTest.php
│ │ │ ├── VariablesAreInputTypesRuleTest.php
│ │ │ ├── VariablesDefaultValueAllowedRuleTest.php
│ │ │ └── VariablesInAllowedPositionRuleTest.php
│ │ ├── ValidationTest.php
│ │ ├── errors.php
│ │ └── harness.php
│ ├── ValidationTest.php
│ ├── starWars.graphqls
│ ├── starWarsData.php
│ └── starWarsSchema.php
├── TestCase.php
├── Unit/
│ ├── Error/
│ │ ├── GraphQLExceptionTest.php
│ │ └── Handler/
│ │ └── ErrorHandlerTest.php
│ ├── Execution/
│ │ └── ExecutionResultTest.php
│ ├── Language/
│ │ ├── BlockStringValueTest.php
│ │ ├── LexerTest.php
│ │ └── NodeBuilderTest.php
│ ├── Schema/
│ │ └── Resolver/
│ │ └── ResolverRegistryTest.php
│ ├── Type/
│ │ └── Coercer/
│ │ ├── CoercerInterfaceTest.php
│ │ ├── FloatCoercerTest.php
│ │ ├── IntCoercerTest.php
│ │ └── StringCoercerTest.php
│ └── Util/
│ ├── AbstractEnumTest.php
│ ├── NameHelperTest.php
│ ├── NodeComparatorTest.php
│ ├── ValueASTConverterTest.php
│ ├── ValueConverterTest.php
│ └── ValueHelperTest.php
└── utils.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing
Please note the following guidelines before submitting pull requests:
- All new features must be covered by unit tests
- Always create pull requests to the *main* branch
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
---
### What did you do?
### What did you expect to happen?
### What actually happened?
### What version of this project are you using?
Please include code that reproduces the issue. The best reproductions are self-contained scripts with minimal dependencies.
```php
code goes here
```
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
(Please read the [guidelines](.github/CONTRIBUTING.md) before creating PRs.)
Fixes #.
Changes proposed in this pull request:
*
*
*
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on: [push, pull_request, workflow_dispatch]
env:
FORCE_COLOR: 1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php-version: ["7.1", "7.2", "7.3", "7.4"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
- name: Install dependencies
run: |
composer self-update
composer install
- name: Tests
run: |
composer ci
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.1/coveralls.phar -O coveralls.phar
php coveralls.phar -v
================================================
FILE: .gitignore
================================================
/.idea/dictionaries
/.idea/deployment.xml
/.idea/webServers.xml
/.idea/workspace.xml
/.idea/php-test-framework.xml
/coverage/
/vendor/
clover.xml
composer.lock
cachegrind.out.*
phpunit.xml
# TODO: Remove this once the printer has been implemented.
src/Language/Printer*
================================================
FILE: .idea/codeStyles/Project.xml
================================================
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
<option name="ELSE_IF_STYLE" value="COMBINE" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
<option name="ALIGN_CLASS_CONSTANTS" value="true" />
</PHPCodeStyleSettings>
<codeStyleSettings language="GraphQL">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PHP">
<option name="BLANK_LINES_AFTER_PACKAGE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
</codeStyleSettings>
</code_scheme>
</component>
================================================
FILE: .idea/codeStyles/codeStyleConfig.xml
================================================
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
================================================
FILE: .idea/graphql-php.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="Digia\GraphQL\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Digia\GraphQL\Test\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/react/promise" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
================================================
FILE: .idea/inspectionProfiles/Project_Default.xml
================================================
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ForgottenDebugOutputInspection" enabled="true" level="ERROR" enabled_by_default="true">
<option name="configuration">
<list>
<option value="\Codeception\Util\Debug::debug" />
<option value="\Codeception\Util\Debug::pause" />
<option value="\Doctrine\Common\Util\Debug::dump" />
<option value="\Doctrine\Common\Util\Debug::export" />
<option value="\Illuminate\Support\Debug\Dumper::dump" />
<option value="\Symfony\Component\Debug\Debug::enable" />
<option value="\Symfony\Component\Debug\DebugClassLoader::enable" />
<option value="\Symfony\Component\Debug\ErrorHandler::register" />
<option value="\Symfony\Component\Debug\ExceptionHandler::register" />
<option value="\TYPO3\CMS\Core\Utility\DebugUtility::debug" />
<option value="\Zend\Debug\Debug::dump" />
<option value="\Zend\Di\Display\Console::export" />
<option value="dd" />
<option value="debug_print_backtrace" />
<option value="debug_zval_dump" />
<option value="dpm" />
<option value="dpq" />
<option value="dsm" />
<option value="dvm" />
<option value="error_log" />
<option value="kpr" />
<option value="phpinfo" />
<option value="print_r" />
<option value="var_dump" />
<option value="var_export" />
<option value="xdebug_break" />
<option value="xdebug_call_class" />
<option value="xdebug_call_file" />
<option value="xdebug_call_function" />
<option value="xdebug_call_line" />
<option value="xdebug_code_coverage_started" />
<option value="xdebug_debug_zval" />
<option value="xdebug_debug_zval_stdout" />
<option value="xdebug_dump_superglobals" />
<option value="xdebug_enable" />
<option value="xdebug_get_code_coverage" />
<option value="xdebug_get_collected_errors" />
<option value="xdebug_get_declared_vars" />
<option value="xdebug_get_function_stack" />
<option value="xdebug_get_headers" />
<option value="xdebug_get_monitored_functions" />
<option value="xdebug_get_profiler_filename" />
<option value="xdebug_get_stack_depth" />
<option value="xdebug_get_tracefile_name" />
<option value="xdebug_is_enabled" />
<option value="xdebug_memory_usage" />
<option value="xdebug_peak_memory_usage" />
<option value="xdebug_print_function_stack" />
<option value="xdebug_start_code_coverage" />
<option value="xdebug_start_error_collection" />
<option value="xdebug_start_function_monitor" />
<option value="xdebug_start_trace" />
<option value="xdebug_stop_code_coverage" />
<option value="xdebug_stop_error_collection" />
<option value="xdebug_stop_function_monitor" />
<option value="xdebug_stop_trace" />
<option value="xdebug_time_index" />
<option value="xdebug_var_dump" />
</list>
</option>
<option name="migratedIntoUserSpace" value="true" />
</inspection_tool>
<inspection_tool class="MoreThanThreeArgumentsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PhpFullyQualifiedNameUsageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="optionConfiguration">
<list>
<option value="behat/behat" />
<option value="brianium/paratest" />
<option value="codeception/codeception" />
<option value="composer/composer" />
<option value="filp/whoops" />
<option value="friendsofphp/php-cs-fixer" />
<option value="humbug/humbug" />
<option value="infection/infection" />
<option value="jakub-onderka/php-parallel-lint" />
<option value="johnkary/phpunit-speedtrap" />
<option value="mikey179/vfsStream" />
<option value="mockery/mockery" />
<option value="pdepend/pdepend" />
<option value="phan/phan" />
<option value="phing/phing" />
<option value="phpmd/phpmd" />
<option value="phpro/grumphp" />
<option value="phpspec/phpspec" />
<option value="phpspec/prophecy" />
<option value="phpstan/phpstan" />
<option value="phpunit/dbunit" />
<option value="phpunit/phpunit" />
<option value="povils/phpmnd" />
<option value="satooshi/php-coveralls" />
<option value="sebastian/phpcpd" />
<option value="slevomat/coding-standard" />
<option value="squizlabs/php_codesniffer" />
<option value="symfony/debug" />
<option value="symfony/phpunit-bridge" />
<option value="symfony/var-dumper" />
<option value="vimeo/psalm" />
<option value="yiisoft/yii2-debug" />
<option value="yiisoft/yii2-gii" />
<option value="zendframework/zend-debug" />
<option value="zendframework/zend-test" />
</list>
</option>
<option name="optionConfigurationMigrated" value="true" />
</inspection_tool>
</profile>
</component>
================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/graphql-php.iml" filepath="$PROJECT_DIR$/.idea/graphql-php.iml" />
</modules>
</component>
</project>
================================================
FILE: .idea/php.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-token-stream" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/container-interop/container-interop" />
<path value="$PROJECT_DIR$/vendor/league/container" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/ocramius/package-versions" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" />
<path value="$PROJECT_DIR$/vendor/nette/php-generator" />
<path value="$PROJECT_DIR$/vendor/nette/finder" />
<path value="$PROJECT_DIR$/vendor/nette/bootstrap" />
<path value="$PROJECT_DIR$/vendor/jean85/pretty-package-versions" />
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/vendor/nette/di" />
<path value="$PROJECT_DIR$/vendor/nette/robot-loader" />
<path value="$PROJECT_DIR$/vendor/nette/utils" />
<path value="$PROJECT_DIR$/vendor/nette/neon" />
<path value="$PROJECT_DIR$/vendor/react/promise" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings load_method="CUSTOM_LOADER" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" phpunit_phar_path="" />
</phpunit_settings>
</component>
</project>
================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
================================================
FILE: CHANGELOG.md
================================================
# Change log
## 1.1.0
* Add initial support for execution strategies
* Add support for error handling middleware
* Fix some bugs in the error handling
* Fix some type-hint issues
* Run Travis CI tests on PHP 7.3 too, improve build times by caching
## 1.0.3
* Drastically reduce the number of container `make()` ([#332](https://github.com/digiaonline/graphql-php/pull/332))
## 1.0.2
* Expanded the README table of contents somewhat ([#329](https://github.com/digiaonline/graphql-php/pull/329))
* Don't validate the schema again while validating the query against it ([#328](https://github.com/digiaonline/graphql-php/pull/328))
* Fix some incorrect type-hints in `ExecutionResult` ([#327](https://github.com/digiaonline/graphql-php/pull/327))
* Fix resolver example in the README ([#313](https://github.com/digiaonline/graphql-php/pull/313))
## 1.0.1
* Fix a bug where you could not use `false` as value for `Boolean!` input types ([#311](https://github.com/digiaonline/graphql-php/pull/311))
* Add a code of conduct ([#312](https://github.com/digiaonline/graphql-php/pull/312))
* Fix resolver middleware example ([#309](https://github.com/digiaonline/graphql-php/pull/309))
* Introduce `VisitorInfo` concept ([#308](https://github.com/digiaonline/graphql-php/pull/308))
## 1.0.0
* Initial release
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at christofferniska@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Digia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# GraphQL
[](https://github.com/digiaonline/graphql-php/actions)
[](https://coveralls.io/github/digiaonline/graphql-php?branch=main)
[](https://scrutinizer-ci.com/g/digiaonline/graphql-php/?branch=main)
[](https://raw.githubusercontent.com/digiaonline/graphql-php/main/LICENSE)
[](#backers)
[](#sponsors)
This is a PHP implementation of the [GraphQL specification](https://facebook.github.io/graphql/) based on the
JavaScript [reference implementation](https://github.com/graphql/graphql-js).
## Related projects
- [DateTime scalar](https://github.com/digiaonline/graphql-datetime-scalar-php)
- [Relay support](https://github.com/digiaonline/graphql-relay-php)
## Requirements
- PHP version >= 7.1
- ext-mbstring
## Table of contents
- [Installation](#installation)
- [Example](#example)
- [Creating a schema](#creating-a-schema)
- [Resolver registry](#resolver-registry)
- [Resolver middleware](#resolver-middleware)
- [Execution](#execution)
- [Queries](#queries)
- [Resolvers](#resolvers)
- [The N+1 problem](#the-n1-problem)
- [Variables](#variables)
- [Context](#context)
- [Scalars](#scalars)
- [Custom scalars](#custom-scalars)
- [Advanced usage](#advanced-usage)
- [Integration](#integration)
- [Laravel](#laravel)
## Installation
Run the following command to install the package through Composer:
```sh
composer require digiaonline/graphql
```
## Example
Here is a simple example that demonstrates how to build an executable schema from a GraphQL schema file that contains
the Schema Definition Language (SDL) for a Star Wars-themed schema (for the schema definition itself, see below). In
this example we use that SDL to build an executable schema and use it to query for the name of the hero. The result
of that query is an associative array with a structure that resembles the query we ran.
```php
use Digia\GraphQL\Language\FileSourceBuilder;
use function Digia\GraphQL\buildSchema;
use function Digia\GraphQL\graphql;
$sourceBuilder = new FileSourceBuilder(__DIR__ . '/star-wars.graphqls');
$schema = buildSchema($sourceBuilder->build(), [
'Query' => [
'hero' => function ($rootValue, $arguments) {
return getHero($arguments['episode'] ?? null);
},
],
]);
$result = graphql($schema, '
query HeroNameQuery {
hero {
name
}
}');
\print_r($result);
```
The script above produces the following output:
```php
Array
(
[data] => Array
(
[hero] => Array
(
[name] => "R2-D2"
)
)
)
```
The GraphQL schema file used in this example contains the following:
```graphql schema
schema {
query: Query
}
type Query {
hero(episode: Episode): Character
human(id: String!): Human
droid(id: String!): Droid
}
interface Character {
id: String!
name: String
friends: [Character]
appearsIn: [Episode]
}
type Human implements Character {
id: String!
name: String
friends: [Character]
appearsIn: [Episode]
homePlanet: String
}
type Droid implements Character {
id: String!
name: String
friends: [Character]
appearsIn: [Episode]
primaryFunction: String
}
enum Episode { NEWHOPE, EMPIRE, JEDI }
```
## Creating a schema
In order to execute queries against your GraphQL API, you first need to define the structure of your API. This is done
by creating a schema. There are two ways to do this, you can either do it using SDL or you can do it programmatically.
However, we strongly encourage you to use SDL, because it is easier to work with. To make an executable schema from
SDL you need to call the `buildSchema` function.
The `buildSchema` function takes three arguments:
- `$source` The schema definition (SDL) as a `Source` instance
- `$resolverRegistry` An associative array or a `ResolverRegistry` instance that contains all resolvers
- `$options` The options for building the schema, which also includes custom types and directives
To create the `Source` instance you can use the provided `FileSourceBuilder` or `MultiFileSourceBuilder` classes.
### Resolver registry
The resolver registry is essentially a flat map with the type names as its keys and their corresponding resolver
instances as its values. For smaller projects you can use an associative array and lambda functions to define your
resolver registry. However, in larger projects we suggest that you implement your own resolvers instead. You can read
more about resolvers under the [Resolvers](#resolvers) section.
Associative array example:
```php
$schema = buildSchema($source, [
'Query' => [
'hero' => function ($rootValue, $arguments) {
return getHero($arguments['episode'] ?? null);
},
],
]);
```
Resolver class example:
```php
$schema = buildSchema($source, [
'Query' => [
'hero' => new HeroResolver(),
],
]);
```
### Resolver middleware
If you find yourself writing the same logic in multiple resolvers you should consider using middleware. Resolver
middleware allow you to efficiently manage functionality across multiple resolvers.
Before middleware example:
```php
$resolverRegistry = new ResolverRegristry([
'Query' => [
'hero' => function ($rootValue, $arguments) {
return getHero($arguments['episode'] ?? null);
},
],
], [
'middleware' => [new BeforeMiddleware()],
]);
$schema = buildSchema($source, $resolverRegistry);
```
```php
class BeforeMiddleware implements ResolverMiddlewareInterface
{
public function resolve(callable $resolveCallback, $rootValue, array $arguments, $context, ResolveInfo $info) {
$newRootValue = $this->doSomethingBefore();
return $resolveCallback($newRootValue, $arguments, $context, $info);
}
}
```
After middleware example:
```php
$resolverRegistry = new ResolverRegristry([
'Query' => [
'hero' => function ($rootValue, $arguments) {
return getHero($arguments['episode'] ?? null);
},
],
], [
'middleware' => [new AfterMiddleware()],
]);
$schema = buildSchema($source, $resolverRegistry);
```
```php
class AfterMiddleware implements ResolverMiddlewareInterface
{
public function resolve(callable $resolveCallback, $rootValue, array $arguments, $context, ResolveInfo $info) {
$result = $resolveCallback($rootValue, $arguments, $context, $info);
$this->doSomethingAfter();
return $result;
}
}
```
Resolver middleware can be useful for a number of things; such as logging, input sanitization, performance
measurement, authorization and caching.
If you want to learn more about schemas you can refer to the [specification](https://graphql.org/learn/schema/).
## Execution
### Queries
To execute a query against your schema you need to call the `graphql` function and pass it your schema and the query
you wish to execute. You can also run _mutations_ and _subscriptions_ by changing your query.
```php
$query = '
query HeroNameQuery {
hero {
name
}
}';
$result = graphql($schema, $query);
```
If you want to learn more about queries you can refer to the [specification](https://graphql.org/learn/queries/).
### Resolvers
Each type in a schema has a resolver associated with it that allows for resolving the actual value. However, most
types do not need a custom resolver, because they can be resolved using the default resolver. Usually these resolvers
are lambda functions, but you can also define your own resolvers by extending `AbstractTypeResolver` or `AbstractFieldResolver`. Alternatively you can also implement the `ResolverInterface` directly.
A resolver function receives four arguments:
- `$rootValue` The parent object, which can also be `null` in some cases
- `$arguments` The arguments provided to the field in the query
- `$context` A value that is passed to every resolver that can hold important contextual information
- `$info` A value which holds field-specific information relevant to the current query
Lambda function example:
```php
function ($rootValue, array $arguments, $context, ResolveInfo $info): string {
return [
'type' => 'Human',
'id' => '1000',
'name' => 'Luke Skywalker',
'friends' => ['1002', '1003', '2000', '2001'],
'appearsIn' => ['NEWHOPE', 'EMPIRE', 'JEDI'],
'homePlanet' => 'Tatooine',
];
}
```
Type resolver example:
```php
class HumanResolver extends AbstractTypeResolver
{
public function resolveName($rootValue, array $arguments, $context, ResolveInfo $info): string
{
return $rootValue['name'];
}
}
```
Field resolver example:
```php
class NameResolver extends AbstractFieldResolver
{
public function resolve($rootValue, array $arguments, $context, ResolveInfo $info): string
{
return $rootValue['name'];
}
}
```
#### The N+1 problem
The resolver function can return a value, a [promise](https://github.com/reactphp/promise) or an array of promises.
This resolver function below illustrates how to use promise to solve the N+1 problem, the full example can be found in
this [test case](/tests/Functional/Execution/DeferredResolverTest.php).
```php
$movieType = newObjectType([
'fields' => [
'title' => ['type' => stringType()],
'director' => [
'type' => $directorType,
'resolve' => function ($movie, $args) {
DirectorBuffer::add($movie['directorId']);
return new Promise(function (callable $resolve, callable $reject) use ($movie) {
DirectorBuffer::loadBuffered();
$resolve(DirectorBuffer::get($movie['directorId']));
});
}
]
]
]);
```
### Variables
You can pass in variables when executing a query by passing them to the `graphql` function.
```php
$query = '
query HeroNameQuery($id: ID!) {
hero(id: $id) {
name
}
}';
$variables = ['id' => '1000'];
$result = graphql($schema, $query, null, null, $variables);
```
### Context
In case you need to pass in some important contextual information to your queries you can use the `$contextValues`
argument on `graphql` to do so. This data will be passed to all of your resolvers as the `$context` argument.
```php
$contextValues = [
'currentlyLoggedInUser' => $currentlyLoggedInUser,
];
$result = graphql($schema, $query, null, $contextValues, $variables);
```
## Scalars
The leaf nodes in a schema are called scalars and each scalar resolves to some concrete data. The built-in, or
specified scalars in GraphQL are the following:
- Boolean
- Float
- Int
- ID
- String
### Custom scalars
In addition to the specified scalars you can also define your own custom scalars and let your schema know about
them by passing them to the `buildSchema` function as part of its `$options` argument.
Custom Date scalar type example:
```php
$dateType = newScalarType([
'name' => 'Date',
'serialize' => function ($value) {
if ($value instanceof DateTime) {
return $value->format('Y-m-d');
}
return null;
},
'parseValue' => function ($value) {
if (\is_string($value)){
return new DateTime($value);
}
return null;
},
'parseLiteral' => function ($node) {
if ($node instanceof StringValueNode) {
return new DateTime($node->getValue());
}
return null;
},
]);
$schema = buildSchema($source, [
'Query' => QueryResolver::class,
[
'types' => [$dateType],
],
]);
```
Every scalar has to be coerced, which is done by three different functions. The `serialize` function converts a
PHP value into the corresponding output value. The`parseValue` function converts a variable input value into the
corresponding PHP value and the `parseLiteral` function converts an AST literal into the corresponding PHP value.
## Advanced usage
If you are looking for something that isn't yet covered by this documentation your best bet is to take a look at the
[tests](./tests) in this project. You'll be surprised how many examples you'll find there.
## Integration
### Laravel
Here is an example that demonstrates how you can use this library in your Laravel project. You need an application
service to expose this library to your application, a service provider to register that service, a controller and a
route for handling the GraphQL POST requests.
**app/GraphQL/GraphQLService.php**
```php
class GraphQLService
{
private $schema;
public function __construct(Schema $schema)
{
$this->schema = $schema;
}
public function executeQuery(string $query, array $variables, ?string $operationName): array
{
return graphql($this->schema, $query, null, null, $variables, $operationName);
}
}
```
**app/GraphQL/GraphQLServiceProvider.php**
```php
class GraphQLServiceProvider
{
public function register()
{
$this->app->singleton(GraphQLService::class, function () {
$schemaDef = \file_get_contents(__DIR__ . '/schema.graphqls');
$executableSchema = buildSchema($schemaDef, [
'Query' => QueryResolver::class,
]);
return new GraphQLService($executableSchema);
});
}
}
```
**app/GraphQL/GraphQLController.php**
```php
class GraphQLController extends Controller
{
private $graphqlService;
public function __construct(GraphQLService $graphqlService)
{
$this->graphqlService = $graphqlService;
}
public function handle(Request $request): JsonResponse
{
$query = $request->get('query');
$variables = $request->get('variables') ?? [];
$operationName = $request->get('operationName');
$result = $this->graphqlService->executeQuery($query, $variables, $operationName);
return response()->json($result);
}
}
```
**routes/api.php**
```php
Route::post('/graphql', 'app\GraphQL\GraphQLController@handle');
```
## Contributors
This project exists thanks to all the people who contribute. [Contribute](.github/CONTRIBUTING.md).
<a href="graphs/contributors"><img src="https://opencollective.com/graphql-php/contributors.svg?width=890&button=false" /></a>
## Backers
Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/graphql-php#backer)
<a href="https://opencollective.com/graphql-php#backers" target="_blank"><img src="https://opencollective.com/graphql-php/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor](https://opencollective.com/graphql-php#sponsor)
<a href="https://opencollective.com/graphql-php/sponsor/0/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/1/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/2/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/3/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/4/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/5/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/6/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/7/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/8/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/graphql-php/sponsor/9/website" target="_blank"><img src="https://opencollective.com/graphql-php/sponsor/9/avatar.svg"></a>
## License
See [LICENCE](LICENSE).
================================================
FILE: composer.json
================================================
{
"name": "digiaonline/graphql",
"description": "A PHP7 implementation of the GraphQL specifications.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Christoffer Niska",
"email": "christofferniska@gmail.com"
},
{
"name": "Hung Nguyen",
"email": "hungneox@gmail.com"
},
{
"name": "Sam Stenvall",
"email": "sam.stenvall@digia.com"
}
],
"require": {
"php": ">=7.1",
"ext-mbstring": "*",
"league/container": "^3.2",
"react/promise": "^2.5"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"phpstan/phpstan": "^0.9.2"
},
"autoload": {
"files": [
"./src/Error/helpers.php",
"./src/Language/blockStringValue.php",
"./src/Language/utils.php",
"./src/Schema/utils.php",
"./src/Type/definition.php",
"./src/Type/directives.php",
"./src/Type/introspection.php",
"./src/Type/scalars.php",
"./src/Util/utils.php",
"./src/Validation/messages.php",
"./src/api.php"
],
"psr-4": {
"Digia\\GraphQL\\": "./src"
}
},
"scripts": {
"test": [
"phpunit",
"phpstan analyse -l 4 src/"
],
"ci": [
"phpunit --coverage-clover build/logs/clover.xml",
"phpstan analyse -l 4 src/"
]
},
"autoload-dev": {
"files": [
"./tests/Functional/Execution/testClasses.php",
"./tests/Functional/Validation/errors.php",
"./tests/Functional/Validation/harness.php",
"./tests/Functional/starWarsData.php",
"./tests/Functional/starWarsSchema.php",
"./tests/utils.php"
],
"psr-4": {
"Digia\\GraphQL\\Test\\": "./tests"
}
}
}
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
================================================
FILE: src/Error/AbstractException.php
================================================
<?php
namespace Digia\GraphQL\Error;
/**
* Class AbstractException
* @package Digia\GraphQL\Error
*/
abstract class AbstractException extends \Exception
{
}
================================================
FILE: src/Error/FileNotFoundException.php
================================================
<?php
namespace Digia\GraphQL\Error;
/**
* Class FileNotFoundException
* @package Digia\GraphQL\Error
*/
class FileNotFoundException extends AbstractException
{
}
================================================
FILE: src/Error/GraphQLException.php
================================================
<?php
namespace Digia\GraphQL\Error;
use Digia\GraphQL\Language\Node\NodeInterface;
use Digia\GraphQL\Language\Source;
use Digia\GraphQL\Language\SourceLocation;
use Digia\GraphQL\Util\ArrayToJsonTrait;
use Digia\GraphQL\Util\SerializationInterface;
/**
* An GraphQLException describes an exception thrown during the execute
* phase of performing a GraphQL operation. In addition to a message
* and stack trace, it also includes information about the locations in a
* GraphQL document and/or execution result that correspond to the Error.
*/
class GraphQLException extends AbstractException implements SerializationInterface
{
use ArrayToJsonTrait;
/**
* An array of { line, column } locations within the source GraphQL document
* which correspond to this error.
*
* Errors during validation often contain multiple locations, for example to
* point out two things with the same name. Errors during execution include a
* single location, the field which produced the error.
*
* @var array|null
*/
protected $locations;
/**
* An array describing the JSON-path into the execution response which
* corresponds to this error. Only included for errors during execution.
*
* @var string[]|null
*/
protected $path;
/**
* An array of GraphQL AST Nodes corresponding to this error.
*
* @var NodeInterface[]|null
*/
protected $nodes;
/**
* The source GraphQL document for the first location of this error.
*
* Note that if this Error represents more than one node, the source may not
* represent nodes after the first node.
*
* @var Source|null
*/
protected $source;
/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*
* @var int[]|null
*/
protected $positions;
/**
* Extension fields to add to the formatted error.
*
* @var array|null
*/
protected $extensions;
/**
* @var null|\Throwable
*/
protected $originalException;
/**
* ExecutionException constructor.
*
* @param string $message
* @param array|null $nodes
* @param Source|null $source
* @param array|null $positions
* @param array|null $path
* @param array|null $extensions
* @param \Throwable|null $originalException
*/
public function __construct(
string $message,
?array $nodes = null,
?Source $source = null,
?array $positions = null,
?array $path = null,
?array $extensions = null,
?\Throwable $originalException = null
) {
parent::__construct($message);
$this->resolveNodes($nodes);
$this->resolveSource($source);
$this->resolvePositions($positions);
$this->resolveLocations($positions, $source);
$this->path = $path;
$this->extensions = $extensions;
$this->originalException = $originalException;
}
/**
* @return NodeInterface[]
*/
public function getNodes(): ?array
{
return $this->nodes;
}
/**
* @return bool
*/
public function hasSource(): bool
{
return null !== $this->source;
}
/**
* @return Source|null
*/
public function getSource(): ?Source
{
return $this->source;
}
/**
* @return int[]|null
*/
public function getPositions(): ?array
{
return $this->positions;
}
/**
* @return bool
*/
public function hasLocations(): bool
{
return !empty($this->locations);
}
/**
* @return array|null
*/
public function getLocations(): ?array
{
return $this->locations;
}
/**
* @return array|null
*/
public function getLocationsAsArray(): ?array
{
return !empty($this->locations) ? \array_map(function (SourceLocation $location) {
return $location->toArray();
}, $this->locations) : null;
}
/**
* @return array|null
*/
public function getPath(): ?array
{
return $this->path;
}
/**
* @return array|null
*/
public function getExtensions(): ?array
{
return $this->extensions;
}
/**
* @param array|null $extensions
* @return self
*/
public function setExtensions(?array $extensions): self
{
$this->extensions = $extensions;
return $this;
}
/**
* @return \Throwable|null
*/
public function getOriginalException(): ?\Throwable
{
return $this->originalException;
}
/**
* @return null|string
*/
public function getOriginalErrorMessage(): ?string
{
return null !== $this->originalException ? $this->originalException->getMessage() : null;
}
/**
* @inheritdoc
*/
public function toArray(): array
{
$result = [
'message' => $this->message,
// TODO: Do not include `locations` if `null` (similar to `path` and `extensions`).
'locations' => $this->getLocationsAsArray(),
];
if (null !== $this->path) {
$result['path'] = $this->path;
}
if (null !== $this->extensions) {
$result['extensions'] = $this->extensions;
}
return $result;
}
/**
* @inheritdoc
*/
public function __toString(): string
{
return printError($this);
}
/**
* @param array|null $nodes
* @return $this
*/
protected function resolveNodes(?array $nodes): self
{
if (\is_array($nodes)) {
$nodes = !empty($nodes) ? $nodes : [];
} else {
$nodes = [$nodes];
}
$this->nodes = \array_filter($nodes, function ($node) {
return null !== $node;
});
return $this;
}
/**
* @param Source|null $source
* @return $this
*/
protected function resolveSource(?Source $source): self
{
if (null === $source && !empty($this->nodes)) {
$firstNode = $this->nodes[0] ?? null;
$location = null !== $firstNode ? $firstNode->getLocation() : null;
$source = null !== $location ? $location->getSource() : null;
}
$this->source = $source;
return $this;
}
/**
* @param array|null $positions
* @return $this
*/
protected function resolvePositions(?array $positions): self
{
if (null === $positions && !empty($this->nodes)) {
$positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) {
if (null !== $node) {
$location = $node->getLocation();
if (null !== $location) {
$list[] = $location->getStart();
}
}
return $list;
}, []);
}
if (null !== $positions && empty($positions)) {
$positions = null;
}
$this->positions = $positions;
return $this;
}
/**
* @param array|null $positions
* @param Source|null $source
* @return $this
*/
protected function resolveLocations(?array $positions, ?Source $source): self
{
$locations = null;
if (null !== $positions && null !== $source) {
$locations = \array_map(function ($position) use ($source) {
return SourceLocation::fromSource($source, $position);
}, $positions);
} elseif (!empty($this->nodes)) {
$locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) {
$location = $node->getLocation();
if (null !== $location) {
$list[] = SourceLocation::fromSource($location->getSource(), $location->getStart());
}
return $list;
}, []);
}
if ($locations !== null) {
$this->locations = $locations;
}
return $this;
}
}
================================================
FILE: src/Error/Handler/AbstractErrorMiddleware.php
================================================
<?php
namespace Digia\GraphQL\Error\Handler;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
abstract class AbstractErrorMiddleware implements ErrorMiddlewareInterface
{
/**
* @inheritdoc
*/
public function handleError(\Throwable $exception, callable $next)
{
}
/**
* @inheritdoc
*/
public function handleExecutionError(ExecutionException $exception, ExecutionContext $context, callable $next)
{
}
}
================================================
FILE: src/Error/Handler/CallableMiddleware.php
================================================
<?php
namespace Digia\GraphQL\Error\Handler;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
class CallableMiddleware extends AbstractErrorMiddleware
{
/**
* @var callable
*/
protected $handleCallback;
/**
* CallableMiddleware constructor.
* @param callable $handleCallback
*/
public function __construct(callable $handleCallback)
{
$this->handleCallback = $handleCallback;
}
/**
* @inheritdoc
*/
public function handleExecutionError(ExecutionException $exception, ExecutionContext $context, callable $next)
{
\call_user_func($this->handleCallback, $exception, $context, $next);
}
}
================================================
FILE: src/Error/Handler/ErrorHandler.php
================================================
<?php
namespace Digia\GraphQL\Error\Handler;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
class ErrorHandler implements ErrorHandlerInterface
{
/**
* @var ErrorMiddlewareInterface[]
*/
protected $middleware = [];
/**
* ErrorHandler constructor.
* @param ErrorMiddlewareInterface[] $middleware
*/
public function __construct(array $middleware)
{
foreach ($middleware as $mw) {
$this->addMiddleware($mw);
}
}
/**
* @param \Throwable $exception
*/
public function handleError(\Throwable $exception): void
{
$next = function () {
// NO-OP
};
foreach ($this->middleware as $middleware) {
$next = function (\Throwable $exception) use ($middleware, $next) {
return $middleware->handleError($exception, $next);
};
}
$next($exception);
}
/**
* @inheritdoc
*/
public function handleExecutionError(ExecutionException $exception, ExecutionContext $context): void
{
$next = function () {
// NO-OP
};
foreach ($this->middleware as $middleware) {
$next = function (ExecutionException $exception, ExecutionContext $context) use ($middleware, $next) {
return $middleware->handleExecutionError($exception, $context, $next);
};
}
$next($exception, $context);
}
/**
* @param ErrorMiddlewareInterface $middleware
*/
protected function addMiddleware(ErrorMiddlewareInterface $middleware): void
{
\array_unshift($this->middleware, $middleware);
}
}
================================================
FILE: src/Error/Handler/ErrorHandlerInterface.php
================================================
<?php
namespace Digia\GraphQL\Error\Handler;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
interface ErrorHandlerInterface
{
/**
* @param \Throwable $exception
*/
public function handleError(\Throwable $exception): void;
/**
* @param ExecutionException $exception
* @param ExecutionContext $context
*/
public function handleExecutionError(ExecutionException $exception, ExecutionContext $context): void;
}
================================================
FILE: src/Error/Handler/ErrorMiddlewareInterface.php
================================================
<?php
namespace Digia\GraphQL\Error\Handler;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
interface ErrorMiddlewareInterface
{
/**
* @param \Throwable $exception
* @param callable $next
* @return mixed
*/
public function handleError(\Throwable $exception, callable $next);
/**
* @param ExecutionException $exception
* @param ExecutionContext $context
* @param callable $next
* @return mixed
*/
public function handleExecutionError(ExecutionException $exception, ExecutionContext $context, callable $next);
}
================================================
FILE: src/Error/InvalidTypeException.php
================================================
<?php
namespace Digia\GraphQL\Error;
class InvalidTypeException extends GraphQLException
{
}
================================================
FILE: src/Error/InvariantException.php
================================================
<?php
namespace Digia\GraphQL\Error;
/**
* Class InvariantException
* @package Digia\GraphQL\Error
*/
class InvariantException extends AbstractException
{
}
================================================
FILE: src/Error/helpers.php
================================================
<?php
namespace Digia\GraphQL\Error;
use Digia\GraphQL\Language\Source;
use Digia\GraphQL\Language\SourceLocation;
// Format error
/**
* @param GraphQLException|null $error
* @return array
* @throws InvariantException
*/
function formatError(?GraphQLException $error): array
{
if (null === $error) {
throw new InvariantException('Received null error.');
}
return [
'message' => $error->getMessage(),
'locations' => $error->getLocationsAsArray(),
'path' => $error->getPath(),
];
}
// Print error
/**
* @param GraphQLException $error
* @return string
*/
function printError(GraphQLException $error): string
{
$printedLocations = [];
$nodes = $error->getNodes();
if (!empty($nodes)) {
foreach ($nodes as $node) {
$location = $node->getLocation();
if (null !== $location) {
$printedLocations[] = highlightSourceAtLocation(
$location->getSource(),
SourceLocation::fromSource($location->getSource(), $location->getStart())
);
}
}
} elseif ($error->hasSource() && $error->hasLocations()) {
foreach ($error->getLocations() as $location) {
$printedLocations[] = highlightSourceAtLocation($error->getSource(), $location);
}
}
return empty($printedLocations)
? $error->getMessage()
: \implode("\n\n", \array_merge([$error->getMessage()], $printedLocations)) . "\n";
}
/**
* @param Source $source
* @param SourceLocation $location
* @return string
*/
function highlightSourceAtLocation(Source $source, SourceLocation $location): string
{
$line = $location->getLine();
$locationOffset = $source->getLocationOffset();
$lineOffset = $locationOffset->getLine() - 1;
$columnOffset = getColumnOffset($source, $location);
$contextLine = $line + $lineOffset;
$contextColumn = $location->getColumn() + $columnOffset;
$prevLineNum = (string)($contextLine - 1);
$lineNum = (string)$contextLine;
$nextLineNum = (string)($contextLine + 1);
$padLen = \mb_strlen($nextLineNum);
$lines = \preg_split("/\r\n|[\n\r]/", $source->getBody());
$lines = false === $lines ? [] : $lines;
$lines[0] = whitespace($locationOffset->getColumn() - 1) . $lines[0];
$outputLines = [
\sprintf('%s (%s:%s)', $source->getName(), $contextLine, $contextColumn),
$line >= 2 ? leftPad($padLen, $prevLineNum) . ': ' . $lines[$line - 2] : null,
leftPad($padLen, $lineNum) . ': ' . $lines[$line - 1],
whitespace(2 + $padLen + $contextColumn - 1) . '^',
$line < \count($lines) ? leftPad($padLen, $nextLineNum) . ': ' . $lines[$line] : null,
];
return \implode("\n", \array_filter($outputLines, function ($line) {
return null !== $line;
}));
}
/**
* @param Source $source
* @param SourceLocation $location
* @return int
*/
function getColumnOffset(Source $source, SourceLocation $location): int
{
return $location->getLine() === 1 ? $source->getLocationOffset()->getColumn() - 1 : 0;
}
/**
* @param int $length
* @return string
*/
function whitespace(int $length): string
{
return \str_repeat(' ', $length);
}
/**
* @param int $length
* @param string $str
* @return string
*/
function leftPad(int $length, string $str): string
{
return whitespace($length - \mb_strlen($str)) . $str;
}
================================================
FILE: src/Execution/CoercedValue.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\GraphQLException;
class CoercedValue
{
/**
* @var GraphQLException[]
*/
private $errors;
/**
* @var mixed
*/
private $value;
/**
* CoercedValue constructor.
* @param mixed $value
* @param array $errors
*/
public function __construct($value, array $errors = [])
{
$this->errors = $errors;
$this->value = $value;
}
/**
* @return GraphQLException[]
*/
public function getErrors(): array
{
return $this->errors;
}
/**
* @return bool
*/
public function hasErrors(): bool
{
return !empty($this->errors);
}
/**
* @param GraphQLException[] $errors
*/
public function setErrors(array $errors): void
{
$this->errors = $errors;
}
/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}
/**
* @param mixed $value
*/
public function setValue($value): void
{
$this->value = $value;
}
}
================================================
FILE: src/Execution/Execution.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\Handler\ErrorHandlerInterface;
use Digia\GraphQL\Execution\Strategy\FieldCollector;
use Digia\GraphQL\Execution\Strategy\ParallelExecutionStrategy;
use Digia\GraphQL\Execution\Strategy\SerialExecutionStrategy;
use Digia\GraphQL\Language\Node\DocumentNode;
use Digia\GraphQL\Language\Node\FragmentDefinitionNode;
use Digia\GraphQL\Language\Node\FragmentSpreadNode;
use Digia\GraphQL\Language\Node\OperationDefinitionNode;
use Digia\GraphQL\Schema\Schema;
use React\Promise\PromiseInterface;
use function React\Promise\resolve;
class Execution implements ExecutionInterface
{
/**
* @inheritdoc
*/
public function execute(
Schema $schema,
DocumentNode $documentNode,
$rootValue = null,
$contextValue = null,
array $variableValues = [],
?string $operationName = null,
?callable $fieldResolver = null,
?ErrorHandlerInterface $errorHandler = null
): PromiseInterface {
try {
$context = $this->createContext(
$schema,
$documentNode,
$rootValue,
$contextValue,
$variableValues,
$operationName,
$fieldResolver
);
// Return early errors if execution context failed.
if (!empty($context->getErrors())) {
return resolve(new ExecutionResult(null, $context->getErrors()));
}
} catch (ExecutionException $error) {
return resolve(new ExecutionResult(null, [$error]));
}
$fieldCollector = new FieldCollector($context);
$data = $this->executeOperation($operationName, $context, $fieldCollector);
if ($data instanceof PromiseInterface) {
return $data->then(function ($resolvedData) use ($context) {
return new ExecutionResult($resolvedData, $context->getErrors());
});
}
if (null !== $errorHandler) {
foreach ($context->getErrors() as $error) {
$errorHandler->handleExecutionError($error, $context);
}
}
return resolve(new ExecutionResult($data, $context->getErrors()));
}
/**
* @param null|string $operationName
* @param ExecutionContext $context
* @param FieldCollector $fieldCollector
* @return array|mixed|null|PromiseInterface
*/
protected function executeOperation(
?string $operationName,
ExecutionContext $context,
FieldCollector $fieldCollector
) {
$strategy = $operationName === 'mutation'
? new SerialExecutionStrategy($context, $fieldCollector)
: new ParallelExecutionStrategy($context, $fieldCollector);
$result = null;
try {
$result = $strategy->execute();
} catch (ExecutionException $exception) {
$context->addError($exception);
} catch (\Throwable $exception) {
$context->addError(
new ExecutionException($exception->getMessage(), null, null, null, null, null, $exception)
);
}
if ($result instanceof PromiseInterface) {
return $result->then(null, function (ExecutionException $exception) use ($context) {
$context->addError($exception);
return resolve(null);
});
}
return $result;
}
/**
* @param Schema $schema
* @param DocumentNode $documentNode
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rawVariableValues
* @param null|string $operationName
* @param callable|null $fieldResolver
* @return ExecutionContext
* @throws ExecutionException
*/
protected function createContext(
Schema $schema,
DocumentNode $documentNode,
$rootValue,
$contextValue,
$rawVariableValues,
?string $operationName = null,
?callable $fieldResolver = null
): ExecutionContext {
$errors = [];
$fragments = [];
$operation = null;
foreach ($documentNode->getDefinitions() as $definition) {
if ($definition instanceof OperationDefinitionNode) {
if (null === $operationName && null !== $operation) {
throw new ExecutionException(
'Must provide operation name if query contains multiple operations.'
);
}
if (null === $operationName || $definition->getNameValue() === $operationName) {
$operation = $definition;
}
continue;
}
if ($definition instanceof FragmentDefinitionNode || $definition instanceof FragmentSpreadNode) {
$fragments[$definition->getNameValue()] = $definition;
continue;
}
}
if (null === $operation) {
if (null !== $operationName) {
throw new ExecutionException(sprintf('Unknown operation named "%s".', $operationName));
}
throw new ExecutionException('Must provide an operation.');
}
$coercedVariableValues = ValuesResolver::coerceVariableValues(
$schema,
$operation->getVariableDefinitions(),
$rawVariableValues
);
$variableValues = $coercedVariableValues->getValue();
if ($coercedVariableValues->hasErrors()) {
$errors = $coercedVariableValues->getErrors();
}
return new ExecutionContext(
$schema,
$fragments,
$rootValue,
$contextValue,
$variableValues,
$fieldResolver,
$operation,
$errors
);
}
}
================================================
FILE: src/Execution/ExecutionContext.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Language\Node\FragmentDefinitionNode;
use Digia\GraphQL\Language\Node\OperationDefinitionNode;
use Digia\GraphQL\Schema\Schema;
class ExecutionContext
{
/**
* @var Schema
*/
protected $schema;
/**
* @var FragmentDefinitionNode[]
*/
protected $fragments;
/**
* @var mixed
*/
protected $rootValue;
/**
* @var mixed
*/
protected $contextValue;
/**
* @var mixed
*/
protected $variableValues;
/**
* @var callable|null
*/
protected $fieldResolver;
/**
* @var OperationDefinitionNode
*/
protected $operation;
/**
* @var ExecutionException[]
*/
protected $errors;
/**
* ExecutionContext constructor.
*
* @param Schema $schema
* @param FragmentDefinitionNode[] $fragments
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $variableValues
* @param callable|null $fieldResolver
* @param OperationDefinitionNode $operation
* @param array $errors
*/
public function __construct(
Schema $schema,
array $fragments,
$rootValue,
$contextValue,
$variableValues,
?callable $fieldResolver,
OperationDefinitionNode $operation,
array $errors
) {
$this->schema = $schema;
$this->fragments = $fragments;
$this->rootValue = $rootValue;
$this->contextValue = $contextValue;
$this->variableValues = $variableValues;
$this->fieldResolver = $fieldResolver;
$this->operation = $operation;
$this->errors = $errors;
}
/**
* @return mixed
*/
public function getRootValue()
{
return $this->rootValue;
}
/**
* @param mixed $rootValue
* @return ExecutionContext
*/
public function setRootValue($rootValue): ExecutionContext
{
$this->rootValue = $rootValue;
return $this;
}
/**
* @return mixed
*/
public function getContextValue()
{
return $this->contextValue ?? [];
}
/**
* @param mixed $contextValue
* @return ExecutionContext
*/
public function setContextValue($contextValue): ExecutionContext
{
$this->contextValue = $contextValue;
return $this;
}
/**
* @return mixed
*/
public function getVariableValues()
{
return $this->variableValues;
}
/**
* @param mixed $variableValues
* @return ExecutionContext
*/
public function setVariableValues($variableValues): ExecutionContext
{
$this->variableValues = $variableValues;
return $this;
}
/**
* @return bool
*/
public function hasFieldResolver(): bool
{
return null !== $this->fieldResolver;
}
/**
* @return callable|null
*/
public function getFieldResolver(): ?callable
{
return $this->fieldResolver;
}
/**
* @param callable|null $fieldResolver
* @return ExecutionContext
*/
public function setFieldResolver(?callable $fieldResolver): ExecutionContext
{
$this->fieldResolver = $fieldResolver;
return $this;
}
/**
* @return OperationDefinitionNode
*/
public function getOperation(): OperationDefinitionNode
{
return $this->operation;
}
/**
* @return Schema
*/
public function getSchema(): Schema
{
return $this->schema;
}
/**
* @return FragmentDefinitionNode[]
*/
public function getFragments(): array
{
return $this->fragments;
}
/**
* @param ExecutionException $error
* @return ExecutionContext
*/
public function addError(ExecutionException $error): ExecutionContext
{
$this->errors[] = $error;
return $this;
}
/**
* @return ExecutionException[]
*/
public function getErrors(): array
{
return $this->errors;
}
}
================================================
FILE: src/Execution/ExecutionException.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\GraphQLException;
class ExecutionException extends GraphQLException
{
}
================================================
FILE: src/Execution/ExecutionInterface.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\Handler\ErrorHandlerInterface;
use Digia\GraphQL\Language\Node\DocumentNode;
use Digia\GraphQL\Schema\Schema;
use React\Promise\PromiseInterface;
interface ExecutionInterface
{
/**
* @param Schema $schema
* @param DocumentNode $documentNode
* @param mixed $rootValue
* @param mixed $contextValue
* @param array $variableValues
* @param string|null $operationName
* @param callable|null $fieldResolver
* @param ErrorHandlerInterface|null $errorHandler
* @return PromiseInterface
*/
public function execute(
Schema $schema,
DocumentNode $documentNode,
$rootValue = null,
$contextValue = null,
array $variableValues = [],
string $operationName = null,
callable $fieldResolver = null,
?ErrorHandlerInterface $errorHandler = null
): PromiseInterface;
}
================================================
FILE: src/Execution/ExecutionProvider.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use League\Container\ServiceProvider\AbstractServiceProvider;
class ExecutionProvider extends AbstractServiceProvider
{
/**
* @var array
*/
protected $provides = [
ExecutionInterface::class,
];
/**
* @inheritdoc
*/
public function register()
{
$this->container->share(ExecutionInterface::class, Execution::class);
}
}
================================================
FILE: src/Execution/ExecutionResult.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\GraphQLException;
use Digia\GraphQL\Util\ArrayToJsonTrait;
use Digia\GraphQL\Util\SerializationInterface;
class ExecutionResult implements SerializationInterface
{
use ArrayToJsonTrait;
/**
* @var array|null
*/
protected $data;
/**
* @var GraphQLException[]
*/
protected $errors;
/**
* ExecutionResult constructor.
* @param array|null $data
* @param GraphQLException[] $errors
*/
public function __construct(?array $data, array $errors)
{
$this->data = $data;
$this->errors = $errors;
}
/**
* @return array|null
*/
public function getData(): ?array
{
return $this->data;
}
/**
* @return GraphQLException[]
*/
public function getErrors(): array
{
return $this->errors;
}
/**
* @param GraphQLException $error
* @return ExecutionResult
*/
public function addError(GraphQLException $error): ExecutionResult
{
$this->errors[] = $error;
return $this;
}
/**
* @inheritdoc
*/
public function toArray(): array
{
$array = [];
if (!empty($this->errors)) {
$array['errors'] = \array_map(function (GraphQLException $error) {
return $error->toArray();
}, $this->errors);
}
$array['data'] = $this->data;
return $array;
}
}
================================================
FILE: src/Execution/InvalidReturnTypeException.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\GraphQLException;
use Digia\GraphQL\Type\Definition\TypeInterface;
use function Digia\GraphQL\Util\toString;
class InvalidReturnTypeException extends GraphQLException
{
/**
* InvalidReturnTypeException constructor.
*
* @param TypeInterface $returnType
* @param mixed $result
* @param array $fieldNodes
*/
public function __construct(TypeInterface $returnType, $result, array $fieldNodes = [])
{
parent::__construct(
\sprintf('Expected value of type "%s" but got: %s.', (string)$returnType, toString($result)),
$fieldNodes
);
}
}
================================================
FILE: src/Execution/Path.php
================================================
<?php
namespace Digia\GraphQL\Execution;
class Path
{
/**
* @var Path|null
*/
protected $previous;
/**
* @var string|mixed
*/
protected $key;
/**
* Path constructor.
* @param Path|null $previous
* @param string|mixed $key
*/
public function __construct(?Path $previous, $key)
{
$this->previous = $previous;
$this->key = $key;
}
/**
* @return Path|null
*/
public function getPrevious(): ?Path
{
return $this->previous;
}
/**
* @return string|mixed
*/
public function getKey()
{
return $this->key;
}
}
================================================
FILE: src/Execution/ResolveInfo.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Language\Node\FieldNode;
use Digia\GraphQL\Language\Node\OperationDefinitionNode;
use Digia\GraphQL\Schema\Schema;
use Digia\GraphQL\Type\Definition\ObjectType;
use Digia\GraphQL\Type\Definition\TypeInterface;
class ResolveInfo
{
/**
* @var string
*/
protected $fieldName;
/**
* @var FieldNode[]
*/
protected $fieldNodes;
/**
* @var TypeInterface
*/
protected $returnType;
/**
* @var ObjectType
*/
protected $parentType;
/**
* @var array|null
*/
protected $path;
/**
* @var Schema
*/
protected $schema;
/**
* @var array
*/
protected $fragments;
/**
* @var mixed
*/
protected $rootValue;
/**
* @var OperationDefinitionNode
*/
protected $operation;
/**
* @var array
*/
protected $variableValues;
/**
* ResolveInfo constructor.
* @param string $fieldName
* @param FieldNode[] $fieldNodes
* @param TypeInterface $returnType
* @param ObjectType $parentType
* @param array|null $path
* @param Schema $schema
* @param array $fragments
* @param mixed $rootValue
* @param OperationDefinitionNode $operation
* @param array $variableValues
*/
public function __construct(
string $fieldName,
?array $fieldNodes,
TypeInterface $returnType,
ObjectType $parentType,
?array $path,
Schema $schema,
array $fragments,
$rootValue,
OperationDefinitionNode $operation,
array $variableValues
) {
$this->fieldName = $fieldName;
$this->fieldNodes = $fieldNodes;
$this->returnType = $returnType;
$this->parentType = $parentType;
$this->path = $path;
$this->schema = $schema;
$this->fragments = $fragments;
$this->rootValue = $rootValue;
$this->operation = $operation;
$this->variableValues = $variableValues;
}
/**
* @return string
*/
public function getFieldName(): string
{
return $this->fieldName;
}
/**
* @return FieldNode[]
*/
public function getFieldNodes(): array
{
return $this->fieldNodes;
}
/**
* @return TypeInterface
*/
public function getReturnType(): TypeInterface
{
return $this->returnType;
}
/**
* @return ObjectType
*/
public function getParentType(): ObjectType
{
return $this->parentType;
}
/**
* @return array
*/
public function getPath(): ?array
{
return $this->path;
}
/**
* @return Schema
*/
public function getSchema(): Schema
{
return $this->schema;
}
/**
* @return array
*/
public function getFragments(): array
{
return $this->fragments;
}
/**
* @return mixed
*/
public function getRootValue()
{
return $this->rootValue;
}
/**
* @return OperationDefinitionNode
*/
public function getOperation(): OperationDefinitionNode
{
return $this->operation;
}
/**
* @return array
*/
public function getVariableValues(): array
{
return $this->variableValues;
}
}
================================================
FILE: src/Execution/Strategy/AbstractExecutionStrategy.php
================================================
<?php
namespace Digia\GraphQL\Execution\Strategy;
use Digia\GraphQL\Error\GraphQLException;
use Digia\GraphQL\Error\InvalidTypeException;
use Digia\GraphQL\Error\InvariantException;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
use Digia\GraphQL\Execution\InvalidReturnTypeException;
use Digia\GraphQL\Execution\ResolveInfo;
use Digia\GraphQL\Execution\UndefinedFieldException;
use Digia\GraphQL\Execution\ValuesResolver;
use Digia\GraphQL\Language\Node\FieldNode;
use Digia\GraphQL\Language\Node\NodeInterface;
use Digia\GraphQL\Language\Node\OperationDefinitionNode;
use Digia\GraphQL\Schema\Schema;
use Digia\GraphQL\Type\Definition\AbstractTypeInterface;
use Digia\GraphQL\Type\Definition\Field;
use Digia\GraphQL\Type\Definition\LeafTypeInterface;
use Digia\GraphQL\Type\Definition\ListType;
use Digia\GraphQL\Type\Definition\NamedTypeInterface;
use Digia\GraphQL\Type\Definition\NonNullType;
use Digia\GraphQL\Type\Definition\ObjectType;
use Digia\GraphQL\Type\Definition\SerializableTypeInterface;
use Digia\GraphQL\Type\Definition\TypeInterface;
use Digia\GraphQL\Util\ConversionException;
use React\Promise\PromiseInterface;
use function Digia\GraphQL\Type\SchemaMetaFieldDefinition;
use function Digia\GraphQL\Type\TypeMetaFieldDefinition;
use function Digia\GraphQL\Type\TypeNameMetaFieldDefinition;
abstract class AbstractExecutionStrategy implements ExecutionStrategyInterface
{
/**
* @var ExecutionContext
*/
protected $context;
/**
* @var FieldCollector
*/
protected $fieldCollector;
/**
* @var callable
*/
protected $typeResolverCallback;
/**
* @var callable
*/
protected $fieldResolverCallback;
/**
* @param ObjectType $parentType
* @param mixed $rootValue
* @param array $path
* @param array $fields
* @return array|PromiseInterface
* @throws \Throwable
* @throws ExecutionException
*/
abstract public function executeFields(ObjectType $parentType, $rootValue, array $path, array $fields);
/**
* AbstractExecutionStrategy constructor.
*
* @param ExecutionContext $context
* @param FieldCollector $fieldCollector
* @param callable|null $typeResolverCallback
* @param callable|null $fieldResolverCallback
*/
public function __construct(
ExecutionContext $context,
FieldCollector $fieldCollector,
?callable $typeResolverCallback = null,
?callable $fieldResolverCallback = null
) {
$this->context = $context;
$this->fieldCollector = $fieldCollector;
$this->typeResolverCallback = $typeResolverCallback ?? [$this, 'defaultTypeResolver'];
$this->fieldResolverCallback = $fieldResolverCallback ?? [$this, 'defaultFieldResolver'];
}
/**
* @inheritdoc
* @throws ExecutionException
* @throws InvalidTypeException
* @throws InvariantException
* @throws ConversionException
* @throws \Throwable
*/
public function execute()
{
$schema = $this->context->getSchema();
$operation = $this->context->getOperation();
$rootValue = $this->context->getRootValue();
$objectType = $this->getOperationType($schema, $operation);
$fields = [];
$visitedFragmentNames = [];
$path = [];
$fields = $this->fieldCollector->collectFields(
$objectType,
$operation->getSelectionSet(),
$fields,
$visitedFragmentNames
);
// Errors from sub-fields of a NonNull type may propagate to the top level,
// at which point we still log the error and null the parent field, which
// in this case is the entire response.
try {
$result = $this->executeFields($objectType, $rootValue, $path, $fields);
} catch (ExecutionException $exception) {
$this->context->addError($exception);
return null;
} catch (\Throwable $exception) {
$exception = !$exception instanceof ExecutionException
? $this->normalizeException($exception, $fields, $path)
: $exception;
$this->context->addError($exception);
return null;
}
return $result;
}
/**
* @param Schema $schema
* @param OperationDefinitionNode $operation
*
* @return ObjectType|null
* @throws ExecutionException
*/
protected function getOperationType(Schema $schema, OperationDefinitionNode $operation): ?ObjectType
{
switch ($operation->getOperation()) {
case 'query':
return $schema->getQueryType();
case 'mutation':
$mutationType = $schema->getMutationType();
if (null === $mutationType) {
throw new ExecutionException('Schema is not configured for mutations.', [$operation]);
}
return $mutationType;
case 'subscription':
$subscriptionType = $schema->getSubscriptionType();
if (null === $subscriptionType) {
throw new ExecutionException('Schema is not configured for subscriptions.', [$operation]);
}
return $subscriptionType;
default:
throw new ExecutionException('Can only execute queries, mutations and subscriptions.', [$operation]);
}
}
/**
* Resolves the field on the given source object. In particular, this
* figures out the value that the field returns by calling its resolve function,
* then calls completeValue to complete promises, serialize scalars, or execute
* the sub-selection-set for objects.
*
* @param ObjectType $parentType
* @param mixed $rootValue
* @param FieldNode[] $fieldNodes
* @param string[] $path
*
* @return mixed
* @throws \Throwable
* @throws UndefinedFieldException
*/
protected function resolveField(ObjectType $parentType, $rootValue, array $fieldNodes, array $path)
{
$fieldNode = $fieldNodes[0];
$fieldName = $fieldNode->getNameValue();
$field = $this->getFieldDefinition($this->context->getSchema(), $parentType, $fieldName);
if (null === $field) {
throw new UndefinedFieldException($fieldName);
}
$info = $this->createResolveInfo($fieldNodes, $fieldNode, $field, $parentType, $path, $this->context);
$resolveCallback = $this->determineResolveCallback($field, $parentType);
$result = $this->resolveFieldValueOrError(
$field,
$fieldNode,
$resolveCallback,
$rootValue,
$this->context,
$info
);
$result = $this->completeValueCatchingError(
$field->getType(),
$fieldNodes,
$info,
$path,
$result
);
return $result;
}
/**
* @param Field $field
* @param FieldNode $fieldNode
* @param callable $resolveCallback
* @param mixed $rootValue
* @param ExecutionContext $context
* @param ResolveInfo $info
*
* @return array|\Throwable
*/
protected function resolveFieldValueOrError(
Field $field,
FieldNode $fieldNode,
?callable $resolveCallback,
$rootValue,
ExecutionContext $context,
ResolveInfo $info
) {
try {
// Build an associative array of arguments from the field.arguments AST, using the
// variables scope to fulfill any variable references.
$result = $resolveCallback(
$rootValue,
ValuesResolver::coerceArgumentValues($field, $fieldNode, $context->getVariableValues()),
$context->getContextValue(),
$info
);
if ($result instanceof PromiseInterface) {
return $result->then(null, function ($exception) use ($fieldNode, $info) {
return !$exception instanceof ExecutionException
? $this->normalizeException($exception, [$fieldNode], $info->getPath())
: $exception;
});
}
return $result;
} catch (\Throwable $exception) {
return $exception;
}
}
/**
* Normalizes exceptions which are usually a \Throwable,
* but can even be a string or null when resolving promises.
*
* @param mixed $exception
* @param NodeInterface[] $nodes
* @param array $path
* @return ExecutionException
*/
protected function normalizeException($exception, array $nodes, array $path = []): ExecutionException
{
if ($exception instanceof \Throwable) {
return new ExecutionException(
$exception->getMessage(),
$nodes,
null,
null,
$path,
null,
$exception
);
}
if (\is_string($exception)) {
return new ExecutionException(
$exception,
$nodes,
null,
null,
$path
);
}
return new ExecutionException(
'',
$nodes,
null,
null,
$path
);
}
/**
* This is a small wrapper around completeValue which detects and logs error in the execution context.
*
* @param TypeInterface $returnType
* @param FieldNode[] $fieldNodes
* @param ResolveInfo $info
* @param array $path
* @param mixed $result
*
* @return array|null|PromiseInterface
* @throws \Throwable
*/
public function completeValueCatchingError(
TypeInterface $returnType,
array $fieldNodes,
ResolveInfo $info,
array $path,
&$result
) {
try {
$completed = $result instanceof PromiseInterface
? $result->then(function ($resolvedResult) use ($returnType, $fieldNodes, $info, $path) {
return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolvedResult);
})
: $this->completeValue($returnType, $fieldNodes, $info, $path, $result);
if ($completed instanceof PromiseInterface) {
// Note: we don't rely on a `catch` method, but we do expect "thenable"
// to take a second callback for the error case.
return $completed->then(null, function ($exception) use ($fieldNodes, $path, $returnType) {
$this->handleFieldError($exception, $fieldNodes, $path, $returnType);
});
}
return $completed;
} catch (\Throwable $exception) {
$this->handleFieldError($exception, $fieldNodes, $path, $returnType);
return null;
}
}
/**
* Implements the instructions for completeValue as defined in the
* "Field entries" section of the spec.
*
* If the field type is Non-Null, then this recursively completes the value
* for the inner type. It throws a field error if that completion returns null,
* as per the "Nullability" section of the spec.
*
* If the field type is a List, then this recursively completes the value
* for the inner type on each item in the list.
*
* If the field type is a Scalar or Enum, ensures the completed value is a legal
* value of the type by calling the `serialize` method of GraphQL type
* definition.
*
* If the field is an abstract type, determine the runtime type of the value
* and then complete based on that type
*
* Otherwise, the field type expects a sub-selection set, and will complete the
* value by evaluating all sub-selections.
*
* @param TypeInterface $returnType
* @param FieldNode[] $fieldNodes
* @param ResolveInfo $info
* @param array $path
* @param mixed $result
*
* @return array|null|PromiseInterface
* @throws \Throwable
*/
protected function completeValue(
TypeInterface $returnType,
array $fieldNodes,
ResolveInfo $info,
array $path,
&$result
) {
// If result is an Error, throw a located error.
if ($result instanceof \Throwable) {
throw $result;
}
// If field type is NonNull, complete for inner type, and throw field error if result is null.
if ($returnType instanceof NonNullType) {
$completed = $this->completeValue(
$returnType->getOfType(),
$fieldNodes,
$info,
$path,
$result
);
if (null !== $completed) {
return $completed;
}
throw new ExecutionException(
\sprintf(
'Cannot return null for non-nullable field %s.%s.',
(string)$info->getParentType(),
$info->getFieldName()
)
);
}
// If result is null, return null.
if (null === $result) {
return null;
}
// If field type is a leaf type, Scalar or Enum, serialize to a valid value,
// returning null if serialization is not possible.
if ($returnType instanceof ListType) {
return $this->completeListValue($returnType, $fieldNodes, $info, $path, $result);
}
// If field type is Scalar or Enum, serialize to a valid value, returning
// null if serialization is not possible.
if ($returnType instanceof LeafTypeInterface) {
return $this->completeLeafValue($returnType, $result);
}
// If field type is an abstract type, Interface or Union, determine the
// runtime Object type and complete for that type.
if ($returnType instanceof AbstractTypeInterface) {
return $this->completeAbstractValue($returnType, $fieldNodes, $info, $path, $result);
}
// If field type is Object, execute and complete all sub-selections.
if ($returnType instanceof ObjectType) {
return $this->completeObjectValue($returnType, $fieldNodes, $info, $path, $result);
}
throw new ExecutionException(\sprintf('Cannot complete value of unexpected type "%s".', (string)$returnType));
}
/**
* @param ListType $returnType
* @param FieldNode[] $fieldNodes
* @param ResolveInfo $info
* @param array $path
* @param mixed $result
*
* @return array|PromiseInterface
* @throws \Throwable
*/
protected function completeListValue(
ListType $returnType,
array $fieldNodes,
ResolveInfo $info,
array $path,
&$result
) {
if (!\is_array($result) && !$result instanceof \Traversable) {
throw new InvariantException(
\sprintf(
'Expected Array or Traversable, but did not find one for field %s.%s.',
(string)$info->getParentType(),
$info->getFieldName()
)
);
}
$itemType = $returnType->getOfType();
$completedItems = [];
$containsPromise = false;
foreach ($result as $key => $item) {
$fieldPath = $path;
$fieldPath[] = $key;
$completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item);
$completedItems[] = $completedItem;
$containsPromise = $containsPromise || $completedItem instanceof PromiseInterface;
}
return $containsPromise
? \React\Promise\all($completedItems)
: $completedItems;
}
/**
* @param LeafTypeInterface|SerializableTypeInterface $returnType
* @param mixed $result
*
* @return array|PromiseInterface
* @throws InvalidReturnTypeException
*/
protected function completeLeafValue($returnType, &$result)
{
$result = $returnType->serialize($result);
if (null === $result) {
throw new InvalidReturnTypeException($returnType, $result);
}
return $result;
}
/**
* @param AbstractTypeInterface $returnType
* @param FieldNode[] $fieldNodes
* @param ResolveInfo $info
* @param string[] $path
* @param mixed $result
*
* @return array|PromiseInterface
* @throws \Throwable
*/
protected function completeAbstractValue(
AbstractTypeInterface $returnType,
array $fieldNodes,
ResolveInfo $info,
array $path,
&$result
) {
$runtimeType = $returnType->hasResolveTypeCallback()
? $returnType->resolveType($result, $this->context->getContextValue(), $info)
: \call_user_func(
$this->typeResolverCallback,
$result,
$this->context->getContextValue(),
$info,
$returnType
);
if ($runtimeType instanceof PromiseInterface) {
return $runtimeType->then(function ($resolvedRuntimeType) use (
$returnType,
$fieldNodes,
$info,
$path,
&$result
) {
return $this->completeObjectValue(
$this->ensureValidRuntimeType($resolvedRuntimeType, $returnType, $info, $result),
$fieldNodes,
$info,
$path,
$result
);
});
}
$returnType = $this->ensureValidRuntimeType($runtimeType, $returnType, $info, $result);
return $this->completeObjectValue(
$returnType,
$fieldNodes,
$info,
$path,
$result
);
}
/**
* @param ObjectType $returnType
* @param array $fieldNodes
* @param ResolveInfo $info
* @param array $path
* @param mixed $result
*
* @return array|PromiseInterface
* @throws ExecutionException
* @throws InvalidReturnTypeException
* @throws \Throwable
*/
protected function completeObjectValue(
ObjectType $returnType,
array $fieldNodes,
ResolveInfo $info,
array $path,
&$result
) {
// If there is an isTypeOfCallback predicate function, call it with the
// current result. If isTypeOfCallback returns false, then raise an error rather
// than continuing execution.
if ($returnType->hasIsTypeOfCallback()) {
$isTypeOf = $returnType->isTypeOf($result, $this->context->getContextValue(), $info);
if ($isTypeOf instanceof PromiseInterface) {
return $isTypeOf->then(function ($resolvedIsTypeOf) use ($returnType, $result, $fieldNodes, $path) {
if (true === $resolvedIsTypeOf) {
return $this->executeSubFields($returnType, $fieldNodes, $path, $result);
}
throw new InvalidReturnTypeException($returnType, $result, $fieldNodes);
});
}
if (false === $isTypeOf) {
throw new InvalidReturnTypeException($returnType, $result, $fieldNodes);
}
}
return $this->executeSubFields($returnType, $fieldNodes, $path, $result);
}
/**
* @param ObjectType $returnType
* @param FieldNode[] $fieldNodes
* @param array $path
* @param mixed $result
*
* @return array|PromiseInterface
* @throws \Throwable
*/
protected function executeSubFields(ObjectType $returnType, array $fieldNodes, array $path, &$result)
{
$subFields = [];
$visitedFragmentNames = [];
foreach ($fieldNodes as $fieldNode) {
if (null !== $fieldNode->getSelectionSet()) {
$subFields = $this->fieldCollector->collectFields(
$returnType,
$fieldNode->getSelectionSet(),
$subFields,
$visitedFragmentNames
);
}
}
if (!empty($subFields)) {
return $this->executeFields($returnType, $result, $path, $subFields);
}
return $result;
}
/**
* @param NamedTypeInterface|string $runtimeTypeOrName
* @param NamedTypeInterface $returnType
* @param ResolveInfo $info
* @param mixed $result
*
* @return TypeInterface|ObjectType|null
* @throws ExecutionException
* @throws InvariantException
*/
protected function ensureValidRuntimeType(
$runtimeTypeOrName,
NamedTypeInterface $returnType,
ResolveInfo $info,
&$result
) {
/** @var NamedTypeInterface $runtimeType */
$runtimeType = \is_string($runtimeTypeOrName)
? $this->context->getSchema()->getType($runtimeTypeOrName)
: $runtimeTypeOrName;
$runtimeTypeName = $runtimeType->getName();
$returnTypeName = $returnType->getName();
if (!$runtimeType instanceof ObjectType) {
$parentTypeName = $info->getParentType()->getName();
$fieldName = $info->getFieldName();
throw new ExecutionException(
\sprintf(
'Abstract type %s must resolve to an Object type at runtime for field %s.%s ' .
'with value "%s", received "%s".',
$returnTypeName,
$parentTypeName,
$fieldName,
$result,
$runtimeTypeName
)
);
}
if (!$this->context->getSchema()->isPossibleType($returnType, $runtimeType)) {
throw new ExecutionException(
\sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeTypeName, $returnTypeName)
);
}
if ($runtimeType !== $this->context->getSchema()->getType($runtimeType->getName())) {
throw new ExecutionException(
\sprintf(
'Schema must contain unique named types but contains multiple types named "%s". ' .
'Make sure that `resolveType` function of abstract type "%s" returns the same ' .
'type instance as referenced anywhere else within the schema.',
$runtimeTypeName,
$returnTypeName
)
);
}
return $runtimeType;
}
/**
* @param Schema $schema
* @param ObjectType $parentType
* @param string $fieldName
*
* @return Field|null
* @throws InvariantException
*/
public function getFieldDefinition(Schema $schema, ObjectType $parentType, string $fieldName): ?Field
{
if ($fieldName === '__schema' && $schema->getQueryType() === $parentType) {
return SchemaMetaFieldDefinition();
}
if ($fieldName === '__type' && $schema->getQueryType() === $parentType) {
return TypeMetaFieldDefinition();
}
if ($fieldName === '__typename') {
return TypeNameMetaFieldDefinition();
}
$fields = $parentType->getFields();
return $fields[$fieldName] ?? null;
}
/**
* @param Field $field
* @param ObjectType $parentType
*
* @return callable
*/
protected function determineResolveCallback(Field $field, ObjectType $parentType): callable
{
if ($field->hasResolveCallback()) {
return $field->getResolveCallback();
}
if ($parentType->hasResolveCallback()) {
return $parentType->getResolveCallback();
}
if ($this->context->hasFieldResolver()) {
return $this->context->getFieldResolver();
}
return $this->fieldResolverCallback;
}
/**
* @param \Throwable $originalException
* @param array $fieldNodes
* @param array $path
* @param TypeInterface $returnType
* @throws ExecutionException
*/
protected function handleFieldError(
\Throwable $originalException,
array $fieldNodes,
array $path,
TypeInterface $returnType
): void {
$exception = $this->buildLocatedError($originalException, $fieldNodes, $path);
// If the field type is non-nullable, then it is resolved without any
// protection from errors, however it still properly locates the error.
if ($returnType instanceof NonNullType) {
throw $exception;
}
// Otherwise, error protection is applied, logging the error and resolving
// a null value for this field if one is encountered.
$this->context->addError($exception);
}
/**
* @param \Throwable $originalException
* @param NodeInterface[] $nodes
* @param string[] $path
*
* @return ExecutionException
*/
protected function buildLocatedError(
\Throwable $originalException,
array $nodes = [],
array $path = []
): ExecutionException {
return new ExecutionException(
$originalException->getMessage(),
$originalException instanceof GraphQLException
? $originalException->getNodes()
: $nodes,
$originalException instanceof GraphQLException
? $originalException->getSource()
: null,
$originalException instanceof GraphQLException
? $originalException->getPositions()
: null,
$originalException instanceof GraphQLException
? ($originalException->getPath() ?? $path)
: $path,
null,
$originalException
);
}
/**
* @param FieldNode[] $fieldNodes
* @param FieldNode $fieldNode
* @param Field $field
* @param ObjectType $parentType
* @param array|null $path
* @param ExecutionContext $context
*
* @return ResolveInfo
*/
protected function createResolveInfo(
array $fieldNodes,
FieldNode $fieldNode,
Field $field,
ObjectType $parentType,
?array $path,
ExecutionContext $context
): ResolveInfo {
return new ResolveInfo(
$fieldNode->getNameValue(),
$fieldNodes,
$field->getType(),
$parentType,
$path,
$context->getSchema(),
$context->getFragments(),
$context->getRootValue(),
$context->getOperation(),
$context->getVariableValues()
);
}
/**
* @param mixed $value
* @param mixed $context
* @param ResolveInfo $info
* @param AbstractTypeInterface $abstractType
*
* @return mixed
* @throws InvariantException
*/
public static function defaultTypeResolver(
$value,
$context,
ResolveInfo $info,
AbstractTypeInterface $abstractType
) {
// First, look for `__typename`.
if (\is_array($value) && isset($value['__typename'])) {
return $value['__typename'];
}
// Otherwise, test each possible type.
/** @var ObjectType[] $possibleTypes */
$possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
$promises = [];
foreach ($possibleTypes as $index => $type) {
$isTypeOf = $type->isTypeOf($value, $context, $info);
if ($isTypeOf instanceof PromiseInterface) {
$promises[$index] = $isTypeOf;
}
if (true === $isTypeOf) {
return $type;
}
}
if (!empty($promises)) {
return \React\Promise\all($promises)->then(function ($resolvedPromises) use ($possibleTypes) {
foreach ($resolvedPromises as $index => $result) {
if (true === $result) {
return $possibleTypes[$index];
}
}
return null;
});
}
return null;
}
/**
* Try to resolve a field without any field resolver function.
*
* @param array|object $rootValue
* @param array $arguments
* @param mixed $contextValues
* @param ResolveInfo $info
*
* @return mixed|null
*/
public static function defaultFieldResolver($rootValue, array $arguments, $contextValues, ResolveInfo $info)
{
$fieldName = $info->getFieldName();
$property = null;
if (\is_array($rootValue) && isset($rootValue[$fieldName])) {
$property = $rootValue[$fieldName];
}
if (\is_object($rootValue)) {
$getter = 'get' . \ucfirst($fieldName);
if (\method_exists($rootValue, $getter)) {
$property = $rootValue->{$getter}();
} elseif (\method_exists($rootValue, $fieldName)) {
$property = $rootValue->{$fieldName}($rootValue, $arguments, $contextValues, $info);
} elseif (\property_exists($rootValue, $fieldName)) {
$property = $rootValue->{$fieldName};
}
}
return $property instanceof \Closure
? $property($rootValue, $arguments, $contextValues, $info)
: $property;
}
}
================================================
FILE: src/Execution/Strategy/ExecutionStrategyInterface.php
================================================
<?php
namespace Digia\GraphQL\Execution\Strategy;
interface ExecutionStrategyInterface
{
/**
* @return mixed
*/
public function execute();
}
================================================
FILE: src/Execution/Strategy/FieldCollector.php
================================================
<?php
namespace Digia\GraphQL\Execution\Strategy;
use Digia\GraphQL\Error\InvalidTypeException;
use Digia\GraphQL\Error\InvariantException;
use Digia\GraphQL\Execution\ExecutionContext;
use Digia\GraphQL\Execution\ExecutionException;
use Digia\GraphQL\Execution\ValuesResolver;
use Digia\GraphQL\Language\Node\FieldNode;
use Digia\GraphQL\Language\Node\FragmentDefinitionNode;
use Digia\GraphQL\Language\Node\FragmentSpreadNode;
use Digia\GraphQL\Language\Node\InlineFragmentNode;
use Digia\GraphQL\Language\Node\NodeInterface;
use Digia\GraphQL\Language\Node\SelectionSetNode;
use Digia\GraphQL\Type\Definition\AbstractTypeInterface;
use Digia\GraphQL\Type\Definition\Directive;
use Digia\GraphQL\Type\Definition\ObjectType;
use Digia\GraphQL\Util\ConversionException;
use Digia\GraphQL\Util\TypeASTConverter;
class FieldCollector
{
/**
* @var ExecutionContext
*/
protected $context;
/**
* @var Directive
*/
protected $skipDirective;
/**
* @var Directive
*/
protected $includeDirective;
/**
* FieldCollector constructor.
* @param ExecutionContext $context
*/
public function __construct(ExecutionContext $context)
{
$this->context = $context;
$this->skipDirective = SkipDirective();
$this->includeDirective = IncludeDirective();
}
/**
* @param ObjectType $runtimeType
* @param SelectionSetNode $selectionSet
* @param array $fields
* @param array $visitedFragmentNames
* @return array
* @throws InvalidTypeException
* @throws ExecutionException
* @throws InvariantException
* @throws ConversionException
*/
public function collectFields(
ObjectType $runtimeType,
SelectionSetNode $selectionSet,
array &$fields,
array &$visitedFragmentNames
): array {
foreach ($selectionSet->getSelections() as $selection) {
// Check if this Node should be included first
if (!$this->shouldIncludeNode($selection)) {
continue;
}
// Collect fields
if ($selection instanceof FieldNode) {
$fieldName = $selection->getAliasOrNameValue();
if (!isset($fields[$fieldName])) {
$fields[$fieldName] = [];
}
$fields[$fieldName][] = $selection;
continue;
}
if ($selection instanceof InlineFragmentNode) {
if (!$this->doesFragmentConditionMatch($selection, $runtimeType)) {
continue;
}
$this->collectFields($runtimeType, $selection->getSelectionSet(), $fields, $visitedFragmentNames);
continue;
}
if ($selection instanceof FragmentSpreadNode) {
$fragmentName = $selection->getNameValue();
if (isset($visitedFragmentNames[$fragmentName])) {
continue;
}
$visitedFragmentNames[$fragmentName] = true;
$fragment = $this->context->getFragments()[$fragmentName];
$this->collectFields($runtimeType, $fragment->getSelectionSet(), $fields, $visitedFragmentNames);
continue;
}
}
return $fields;
}
/**
* @param NodeInterface $node
* @return bool
* @throws ExecutionException
* @throws InvalidTypeException
* @throws InvariantException
*/
protected function shouldIncludeNode(NodeInterface $node): bool
{
$contextVariables = $this->context->getVariableValues();
$skip = ValuesResolver::coerceDirectiveValues($this->skipDirective, $node, $contextVariables);
if ($skip && $skip['if'] === true) {
return false;
}
$include = ValuesResolver::coerceDirectiveValues($this->includeDirective, $node, $contextVariables);
if ($include && $include['if'] === false) {
return false;
}
return true;
}
/**
* @param FragmentDefinitionNode|InlineFragmentNode $fragment
* @param ObjectType $type
* @return bool
* @throws InvariantException
* @throws ConversionException
*/
protected function doesFragmentConditionMatch($fragment, ObjectType $type): bool
{
$typeConditionNode = $fragment->getTypeCondition();
if (null === $typeConditionNode) {
return true;
}
$conditionalType = TypeASTConverter::convert($this->context->getSchema(), $typeConditionNode);
if ($type === $conditionalType) {
return true;
}
if ($conditionalType instanceof AbstractTypeInterface) {
return $this->context->getSchema()->isPossibleType($conditionalType, $type);
}
return false;
}
}
================================================
FILE: src/Execution/Strategy/ParallelExecutionStrategy.php
================================================
<?php
namespace Digia\GraphQL\Execution\Strategy;
use Digia\GraphQL\Execution\UndefinedFieldException;
use Digia\GraphQL\Type\Definition\ObjectType;
use React\Promise\PromiseInterface;
use function Digia\GraphQL\Util\promiseForMap;
/**
* Implements the "Evaluating selection sets" section of the spec
* for "read" mode.
*
* Class ParallelExecutionStrategy
* @package Digia\GraphQL\Execution\Strategy
*/
class ParallelExecutionStrategy extends AbstractExecutionStrategy
{
/**
* @inheritdoc
*/
public function executeFields(ObjectType $parentType, $rootValue, array $path, array $fields)
{
$results = [];
$containsPromise = false;
foreach ($fields as $fieldName => $fieldNodes) {
$fieldPath = $path;
$fieldPath[] = $fieldName;
try {
$result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath);
} catch (UndefinedFieldException $exception) {
continue;
}
$containsPromise = $containsPromise || $result instanceof PromiseInterface;
$results[$fieldName] = $result;
}
if (!$containsPromise) {
return $results;
}
// Otherwise, results is a map from field name to the result of resolving that
// field, which is possibly a promise. Return a promise that will return this
// same map, but with any promises replaced with the values they resolved to.
return promiseForMap($results);
}
}
================================================
FILE: src/Execution/Strategy/SerialExecutionStrategy.php
================================================
<?php
namespace Digia\GraphQL\Execution\Strategy;
use Digia\GraphQL\Execution\UndefinedFieldException;
use Digia\GraphQL\Type\Definition\ObjectType;
use React\Promise\PromiseInterface;
use function Digia\GraphQL\Util\promiseReduce;
/**
* Implements the "Evaluating selection sets" section of the spec
* for "write" mode.
*
* Class SerialExecutionStrategy
* @package Digia\GraphQL\Execution\Strategy
*/
class SerialExecutionStrategy extends AbstractExecutionStrategy
{
/**
* @inheritdoc
*/
public function executeFields(ObjectType $parentType, $rootValue, array $path, array $fields)
{
return promiseReduce(
\array_keys($fields),
function ($results, $fieldName) use ($parentType, $rootValue, $path, $fields) {
$fieldNodes = $fields[$fieldName];
$fieldPath = $path;
$fieldPath[] = $fieldName;
try {
$result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath);
} catch (UndefinedFieldException $exception) {
return null;
}
if ($result instanceof PromiseInterface) {
return $result->then(function ($resolvedResult) use ($fieldName, $results) {
$results[$fieldName] = $resolvedResult;
return $results;
});
}
$results[$fieldName] = $result;
return $results;
}
);
}
}
================================================
FILE: src/Execution/UndefinedFieldException.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\AbstractException;
class UndefinedFieldException extends AbstractException
{
/**
* UndefinedFieldDefinitionException constructor.
*/
public function __construct(string $fieldName)
{
parent::__construct(\sprintf('Undefined field "%s".', $fieldName));
}
}
================================================
FILE: src/Execution/ValuesResolver.php
================================================
<?php
namespace Digia\GraphQL\Execution;
use Digia\GraphQL\Error\GraphQLException;
use Digia\GraphQL\Error\InvalidTypeException;
use Digia\GraphQL\Error\InvariantException;
use Digia\GraphQL\Language\Node\ArgumentNode;
use Digia\GraphQL\Language\Node\ArgumentsAwareInterface;
use Digia\GraphQL\Language\Node\NameAwareInterface;
use Digia\GraphQL\Language\Node\NodeInterface;
use Digia\GraphQL\Language\Node\NullValueNode;
use Digia\GraphQL\Language\Node\VariableDefinitionNode;
use Digia\GraphQL\Language\Node\VariableNode;
use Digia\GraphQL\Schema\Schema;
use Digia\GraphQL\Type\Coercer\CoercingException;
use Digia\GraphQL\Type\Definition\Directive;
use Digia\GraphQL\Type\Definition\EnumType;
use Digia\GraphQL\Type\Definition\EnumValue;
use Digia\GraphQL\Type\Definition\Field;
use Digia\GraphQL\Type\Definition\InputObjectType;
use Digia\GraphQL\Type\Definition\ListType;
use Digia\GraphQL\Type\Definition\NonNullType;
use Digia\GraphQL\Type\Definition\ScalarType;
use Digia\GraphQL\Type\Definition\TypeInterface;
use Digia\GraphQL\Type\Definition\WrappingTypeInterface;
use Digia\GraphQL\Util\ConversionException;
use Digia\GraphQL\Util\TypeASTConverter;
use Digia\GraphQL\Util\ValueASTConverter;
use function Digia\GraphQL\Test\jsonEncode;
use function Digia\GraphQL\Util\find;
use function Digia\GraphQL\Util\invariant;
use function Digia\GraphQL\Util\keyMap;
use function Digia\GraphQL\Util\suggestionList;
class ValuesResolver
{
/**
* Prepares an object map of argument values given a list of argument
* definitions and list of argument AST nodes.
*
* @see https://facebook.github.io/graphql/October2016/#CoerceArgumentValues()
*
* @param Field|Directive $definition
* @param ArgumentsAwareInterface $node
* @param array $variableValues
* @return array
* @throws ExecutionException
* @throws InvariantException
*/
public static function coerceArgumentValues(
$definition,
ArgumentsAwareInterface $node,
array $variableValues = []
): array {
$coercedValues = [];
$argumentDefinitions = $definition->getArguments();
$argumentNodes = $node->getArguments();
if (empty($argumentDefinitions)) {
return $coercedValues;
}
/** @var ArgumentNode[] $argumentNodeMap */
$argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) {
return $value->getNameValue();
});
foreach ($argumentDefinitions as $argumentDefinition) {
$argumentName = $argumentDefinition->getName();
$argumentType = $argumentDefinition->getType();
$argumentNode = $argumentNodeMap[$argumentName] ?? null;
$defaultValue = $argumentDefinition->getDefaultValue();
$argumentValue = null !== $argumentNode ? $argumentNode->getValue() : null;
if (null !== $argumentNode && $argumentValue instanceof VariableNode) {
$variableName = $argumentValue->getNameValue();
$hasValue = !empty($variableValues) && \array_key_exists($variableName, $variableValues);
$isNull = $hasValue && null === $variableValues[$variableName];
} else {
$hasValue = null !== $argumentNode;
$isNull = $hasValue && $argumentValue instanceof NullValueNode;
}
if (!$hasValue && null !== $defaultValue) {
// If no argument was provided where the definition has a default value,
// use the default value.
$coercedValues[$argumentName] = $defaultValue;
} elseif ((!$hasValue || $isNull) && $argumentType instanceof NonNullType) {
// If no argument or a null value was provided to an argument with a
// non-null type (required), produce a field error.
if ($isNull) {
throw new ExecutionException(
\sprintf(
'Argument "%s" of non-null type "%s" must not be null.',
$argumentName,
$argumentType
),
[$argumentValue]
);
} elseif (null !== $argumentNode && $argumentValue instanceof VariableNode) {
$variableName = $argumentValue->getNameValue();
throw new ExecutionException(
\sprintf(
'Argument "%s" of required type "%s" was provided the variable "$%s" '
. 'which was not provided a runtime value.',
$argumentName,
$argumentType,
$variableName
),
[$argumentValue]
);
} else {
throw new ExecutionException(
\sprintf(
'Argument "%s" of required type "%s" was not provided.',
$argumentName,
$argumentType
),
[$node]
);
}
} elseif ($hasValue) {
if ($argumentValue instanceof NullValueNode) {
// If the explicit value `null` was provided, an entry in the coerced
// values must exist as the value `null`.
$coercedValues[$argumentName] = null;
} elseif ($argumentValue instanceof VariableNode) {
$variableName = $argumentValue->getNameValue();
invariant(!empty($variableValues), 'Must exist for hasValue to be true.');
// Note: This does no further checking that this variable is correct.
// This assumes that this query has been validated and the variable
// usage here is of the correct type.
$coercedValues[$argumentName] = $variableValues[$variableName];
} else {
$valueNode = $argumentNode->getValue();
try {
// Value nodes that cannot be resolved should be treated as invalid values
// because there is no undefined value in PHP so that we throw an exception
$coercedValue = ValueASTConverter::convert($valueNode, $argumentType, $variableValues);
} catch (\Exception $ex) {
// Note: ValuesOfCorrectType validation should catch this before
// execution. This is a runtime check to ensure execution does not
// continue with an invalid argument value.
throw new ExecutionException(
\sprintf(
'Argument "%s" has invalid value %s.',
$argumentName,
(string)$argumentValue
),
[$argumentValue],
null,
null,
null,
null,
$ex
);
}
$coercedValues[$argumentName] = $coercedValue;
}
}
}
return $coercedValues;
}
/**
* Prepares an object map of argument values given a directive definition
* and a AST node which may contain directives. Optionally also accepts a map
* of variable values.
*
* If the directive does not exist on the node, returns null.
*
* @param Directive $directive
* @param mixed $node
* @param array $variableValues
* @return array|null
* @throws ExecutionException
* @throws InvariantException
*/
public static function coerceDirectiveValues(
Directive $directive,
$node,
array $variableValues = []
): ?array {
$directiveNode = $node->hasDirectives()
? find($node->getDirectives(), function (NameAwareInterface $value) use ($directive) {
return $value->getNameValue() === $directive->getName();
}) : null;
if (null !== $directiveNode) {
return static::coerceArgumentValues($directive, $directiveNode, $variableValues);
}
return null;
}
/**
* Prepares an object map of variableValues of the correct type based on the
* provided variable definitions and arbitrary input. If the input cannot be
* parsed to match the variable definitions, a GraphQLError will be thrown.
*
* @param Schema $schema
* @param array|VariableDefinitionNode[] $variableDefinitionNodes
* @param array $inputs
* @return CoercedValue
* @throws GraphQLException
* @throws InvariantException
* @throws ConversionException
*/
public static function coerceVariableValues(
Schema $schema,
array $variableDefinitionNodes,
array $inputs
): CoercedValue {
$coercedValues = [];
$errors = [];
foreach ($variableDefinitionNodes as $variableDefinitionNode) {
$variableName = $variableDefinitionNode->getVariable()->getNameValue();
$variableType = TypeASTConverter::convert($schema, $variableDefinitionNode->getType());
$variableTypeName = (string)$variableType;
if ($variableTypeName === '') {
$variableTypeName = (string)$variableDefinitionNode;
}
if (!static::isInputType($variableType)) {
// Must use input types for variables. This should be caught during
// validation, however is checked again here for safety.
$errors[] = static::buildCoerceException(
\sprintf(
'Variable "$%s" expected value of type "%s" which cannot be used as an input type',
$variableName,
$variableTypeName
),
$variableDefinitionNode,
null
);
} else {
$hasValue = \array_key_exists($variableName, $inputs);
$value = $hasValue ? $inputs[$variableName] : null;
if (!$hasValue && $variableDefinitionNode->hasDefaultValue()) {
// If no value was provided to a variable with a default value,
// use the default value.
$coercedValues[$variableName] = ValueASTConverter::convert(
$variableDefinitionNode->getDefaultValue(),
$variableType
);
} elseif ((!$hasValue || null === $value) && $variableType instanceof NonNullType) {
// If no value or a nullish value was provided to a variable with a
// non-null type (required), produce an error.
$errors[] = static::buildCoerceException(
\sprintf(
$value
? 'Variable "$%s" of non-null type "%s" must not be null'
: 'Variable "$%s" of required type "%s" was not provided',
$variableName,
$variableTypeName
),
$variableDefinitionNode,
null
);
} elseif ($hasValue) {
if (null === $value) {
// If the explicit value `null` was provided, an entry in the coerced
// values must exist as the value `null`.
$coercedValues[$variableName] = null;
} else {
// Otherwise, a non-null value was provided, coerce it to the expected
// type or report an error if coercion fails.
$coercedValue = static::coerceValue($value, $variableType, $variableDefinitionNode);
if ($coercedValue->hasErrors()) {
$message = \sprintf(
'Variable "$%s" got invalid value %s',
$variableName,
jsonEncode($value)
);
foreach ($coercedValue->getErrors() as $error) {
$errors[] = static::buildCoerceException(
$message,
$variableDefinitionNode,
null,
$error->getMessage(),
$error
);
}
} else {
$coercedValues[$variableName] = $coercedValue->getValue();
}
}
}
}
}
return new CoercedValue($coercedValues, $errors);
}
/**
* @param TypeInterface|null $type
* @return bool
*/
protected static function isInputType(?TypeInterface $type)
{
return ($type instanceof ScalarType) ||
($type instanceof EnumType) ||
($type instanceof InputObjectType) ||
(($type instanceof WrappingTypeInterface) && static::isInputType($type->getOfType()));
}
/**
* Returns either a value which is valid for the provided type or a list of
* encountered coercion errors.
*
* @param mixed|array $value
* @param mixed $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
* @throws GraphQLException
* @throws InvariantException
*/
protected static function coerceValue($value, $type, $blameNode, ?Path $path = null): CoercedValue
{
if ($type instanceof NonNullType) {
return static::coerceValueForNonNullType($value, $type, $blameNode, $path);
}
if (null === $value) {
return new CoercedValue(null);
}
if ($type instanceof ScalarType) {
return static::coerceValueForScalarType($value, $type, $blameNode, $path);
}
if ($type instanceof EnumType) {
return static::coerceValueForEnumType($value, $type, $blameNode, $path);
}
if ($type instanceof ListType) {
return static::coerceValueForListType($value, $type, $blameNode, $path);
}
if ($type instanceof InputObjectType) {
return static::coerceValueForInputObjectType($value, $type, $blameNode, $path);
}
throw new GraphQLException('Unexpected type.');
}
/**
* @param mixed $value
* @param NonNullType $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
* @throws GraphQLException
* @throws InvariantException
*/
protected static function coerceValueForNonNullType(
$value,
NonNullType $type,
NodeInterface $blameNode,
?Path $path
): CoercedValue {
if (null === $value) {
return new CoercedValue(null, [
static::buildCoerceException(
\sprintf('Expected non-nullable type %s not to be null', (string)$type),
$blameNode,
$path
)
]);
}
return static::coerceValue($value, $type->getOfType(), $blameNode, $path);
}
/**
* Scalars determine if a value is valid via parseValue(), which can
* throw to indicate failure. If it throws, maintain a reference to
* the original error.
*
* @param mixed $value
* @param ScalarType $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
*/
protected static function coerceValueForScalarType(
$value,
ScalarType $type,
NodeInterface $blameNode,
?Path $path
): CoercedValue {
try {
$parseResult = $type->parseValue($value);
if (null === $parseResult) {
return new CoercedValue(null, [
new GraphQLException(\sprintf('Expected type %s', (string)$type))
]);
}
return new CoercedValue($parseResult);
} /** @noinspection PhpRedundantCatchClauseInspection */ catch (InvalidTypeException|CoercingException $ex) {
return new CoercedValue(null, [
static::buildCoerceException(
\sprintf('Expected type %s', (string)$type),
$blameNode,
$path,
$ex->getMessage(),
$ex
)
]);
}
}
/**
* @param mixed $value
* @param EnumType $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
* @throws InvariantException
*/
protected static function coerceValueForEnumType(
$value,
EnumType $type,
NodeInterface $blameNode,
?Path $path
): CoercedValue {
if (\is_string($value) && null !== ($enumValue = $type->getValue($value))) {
return new CoercedValue($enumValue);
}
$suggestions = suggestionList((string)$value, \array_map(function (EnumValue $enumValue) {
return $enumValue->getName();
}, $type->getValues()));
$didYouMean = (!empty($suggestions))
? 'did you mean' . \implode(',', $suggestions)
: null;
return new CoercedValue(null, [
static::buildCoerceException(\sprintf('Expected type %s', $type->getName()), $blameNode, $path, $didYouMean)
]);
}
/**
* @param mixed $value
* @param InputObjectType $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
* @throws InvariantException
* @throws GraphQLException
*/
protected static function coerceValueForInputObjectType(
$value,
InputObjectType $type,
NodeInterface $blameNode,
?Path $path
): CoercedValue {
$errors = [];
$coercedValues = [];
$fields = $type->getFields();
// Ensure every defined field is valid.
foreach ($fields as $field) {
$fieldType = $field->getType();
if (!isset($value[$field->getName()])) {
if (!empty($field->getDefaultValue())) {
$coercedValue[$field->getName()] = $field->getDefaultValue();
} elseif ($fieldType instanceof NonNullType) {
$errors[] = new GraphQLException(
\sprintf(
"Field %s of required type %s! was not provided.",
static::printPath(new Path($path, $field->getName())),
(string)$fieldType->getOfType()
)
);
}
} else {
$fieldValue = $value[$field->getName()];
$coercedValue = static::coerceValue(
$fieldValue,
$fieldType,
$blameNode,
new Path($path, $field->getName())
);
if ($coercedValue->hasErrors()) {
$errors = \array_merge($errors, $coercedValue->getErrors());
} elseif (empty($errors)) {
$coercedValues[$field->getName()] = $coercedValue->getValue();
}
}
}
// Ensure every provided field is defined.
foreach ($value as $fieldName => $fieldValue) {
if (!isset($fields[$fieldName])) {
$suggestions = suggestionList($fieldName, \array_keys($fields));
$didYouMean = (!empty($suggestions))
? 'did you mean' . \implode(',', $suggestions)
: null;
$errors[] = static::buildCoerceException(
\sprintf('Field "%s" is not defined by type %s', $fieldName, $type->getName()),
$blameNode,
$path,
$didYouMean
);
}
}
return new CoercedValue($coercedValues, $errors);
}
/**
* @param mixed $value
* @param ListType $type
* @param NodeInterface $blameNode
* @param Path|null $path
* @return CoercedValue
* @throws GraphQLException
* @throws InvariantException
*/
protected static function coerceValueForListType(
$value,
ListType $type,
NodeInterface $blameNode,
?Path $path
): CoercedValue {
$itemType = $type->getOfType();
if (\is_array($value) || $value instanceof \Traversable) {
$errors = [];
$coercedValues = [];
foreach ($value as $index => $itemValue) {
$coercedValue = static::coerceValue($itemValue, $itemType, $blameNode, new Path($path, $index));
if ($coercedValue->hasErrors()) {
$errors = \array_merge($errors, $coercedValue->getErrors());
} else {
$coercedValues[] = $coercedValue->getValue();
}
}
return new CoercedValue($coercedValues, $errors);
}
// Lists accept a non-list value as a list of one.
$coercedValue = static::coerceValue($value, $itemType, $blameNode);
return new CoercedValue([$coercedValue->getValue()], $coercedValue->getErrors());
}
/**
* @param string $message
* @param NodeInterface $blameNode
* @param Path|null $path
* @param null|string $subMessage
* @param GraphQLException|null $originalException
* @return GraphQLException
*/
protected static function buildCoerceException(
string $message,
NodeInterface $blameNode,
?Path $path,
?string $subMessage = null,
?GraphQLException $originalException = null
) {
$stringPath = static::printPath($path);
return new CoercingException(
$message .
(($stringPath !== '') ? ' at ' . $stringPath : $stringPath) .
(($subMessage !== null) ? '; ' . $subMessage : '.'),
[$blameNode],
null,
null,
null,
null,
$originalException
);
}
/**
* @param Path|null $path
* @return string
*/
protected static function printPath(?Path $path)
{
$stringPath = '';
$currentPath = $path;
while ($currentPath !== null) {
$stringPath = \is_string($currentPath->getKey())
? '.' . $currentPath->getKey() . $stringPath
: '[' . (string)$currentPath->getKey() . ']' . $stringPath;
$currentPath = $currentPath->getPrevious();
}
return !empty($stringPath) ? 'value' . $stringPath : '';
}
}
================================================
FILE: src/GraphQL.php
================================================
<?php
namespace Digia\GraphQL;
use Digia\GraphQL\Error\Handler\ErrorHandlerInterface;
use Digia\GraphQL\Error\InvariantException;
use Digia\GraphQL\Execution\ExecutionInterface;
use Digia\GraphQL\Execution\ExecutionProvider;
use Digia\GraphQL\Execution\ExecutionResult;
use Digia\GraphQL\Language\LanguageProvider;
use Digia\GraphQL\Language\Node\DocumentNode;
use Digia\GraphQL\Language\Node\NodeInterface;
use Digia\GraphQL\Language\Node\TypeNodeInterface;
use Digia\GraphQL\Language\Node\ValueNodeInterface;
use Digia\GraphQL\Language\NodePrinterInterface;
use Digia\GraphQL\Language\ParserInterface;
use Digia\GraphQL\Language\Source;
use Digia\GraphQL\Language\SyntaxErrorException;
use Digia\GraphQL\Schema\Building\SchemaBuilderInterface;
use Digia\GraphQL\Schema\Building\SchemaBuildingProvider;
use Digia\GraphQL\Schema\Extension\SchemaExtenderInterface;
use Digia\GraphQL\Schema\Extension\SchemaExtensionProvider;
use Digia\GraphQL\Schema\Resolver\ResolverRegistry;
use Digia\GraphQL\Schema\Resolver\ResolverRegistryInterface;
use Digia\GraphQL\Schema\Schema;
use Digia\GraphQL\Schema\Validation\SchemaValidationProvider;
use Digia\GraphQL\Schema\Validation\SchemaValidatorInterface;
use Digia\GraphQL\Type\CoercerProvider;
use Digia\GraphQL\Type\DirectivesProvider;
use Digia\GraphQL\Type\IntrospectionProvider;
use Digia\GraphQL\Type\ScalarTypesProvider;
use Digia\GraphQL\Validation\RulesProvider;
use Digia\GraphQL\Validation\ValidationProvider;
use Digia\GraphQL\Validation\ValidatorInterface;
use League\Container\Container;
use React\Promise\PromiseInterface;
use function React\Promise\resolve;
class GraphQL
{
public const BOOLEAN = 'GraphQLBoolean';
public const FLOAT = 'GraphQLFloat';
public const INT = 'GraphQLInt';
public const ID = 'GraphQLID';
public const STRING = 'GraphQLString';
public const DEPRECATED_DIRECTIVE = 'GraphQLDeprecatedDirective';
public const INCLUDE_DIRECTIVE = 'GraphQLIncludeDirective';
public const SKIP_DIRECTIVE = 'GraphQLSkipDirective';
public const SCHEMA_INTROSPECTION = '__Schema';
public const DIRECTIVE_INTROSPECTION = '__Directive';
public const DIRECTIVE_LOCATION_INTROSPECTION = '__DirectiveLocation';
public const TYPE_INTROSPECTION = '__Type';
public const FIELD_INTROSPECTION = '__Field';
public const INPUT_VALUE_INTROSPECTION = '__InputValue';
public const ENUM_VALUE_INTROSPECTION = '__EnumValue';
public const TYPE_KIND_INTROSPECTION = '__TypeKind';
public const SCHEMA_META_FIELD_DEFINITION = 'SchemaMetaFieldDefinition';
public const TYPE_META_FIELD_DEFINITION = 'TypeMetaFieldDefinition';
public const TYPE_NAME_META_FIELD_DEFINITION = 'TypeNameMetaFieldDefinition';
/**
* @var array
*/
private static $providers = [
LanguageProvider::class,
SchemaBuildingProvider::class,
SchemaExtensionProvider::class,
SchemaValidationProvider::class,
CoercerProvider::class,
IntrospectionProvider::class,
ScalarTypesProvider::class,
DirectivesProvider::class,
RulesProvider::class,
ValidationProvider::class,
ExecutionProvider::class,
];
/**
* @var GraphQL
*/
private static $instance;
/**
* @var Container
*/
protected $container;
/**
* GraphQL constructor.
*/
private function __construct()
{
$container = new Container();
$this->registerProviders($container);
$this->container = $container;
}
/**
* @return GraphQL
*/
public static function getInstance(): self
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
/**
* @param string $id
* @return mixed
*/
public static function make(string $id)
{
return static::getInstance()
->getContainer()
->get($id);
}
/**
* @param Source $source
* @param array|ResolverRegistryInterface $resolverRegistry
* @param array $options
* @return Schema
*/
public static function buildSchema(Source $source, $resolverRegistry, array $options = []): Schema
{
/** @var SchemaBuilderInterface $schemaBuilder */
$schemaBuilder = static::make(SchemaBuilderInterface::class);
return $schemaBuilder->build(
static::parse($source, $options),
$resolverRegistry instanceof ResolverRegistryInterface
? $resolverRegistry
: new ResolverRegistry($resolverRegistry),
$options
);
}
/**
* @param Schema $schema
* @param Source $source
* @param array|ResolverRegistryInterface $resolverRegistry
* @param array $options
* @return Schema
*/
public static function extendSchema(
Schema $schema,
Source $source,
$resolverRegistry,
array $options = []
): Schema {
/** @var SchemaExtenderInterface $schemaExtender */
$schemaExtender = static::make(SchemaExtenderInterface::class);
return $schemaExtender->extend(
$schema,
static::parse($source, $options),
$resolverRegistry instanceof ResolverRegistryInterface
? $resolverRegistry
: new ResolverRegistry($resolverRegistry),
$options
);
}
/**
* @param Schema $schema
* @return array
*/
public static function validateSchema(Schema $schema): array
{
/** @var SchemaValidatorInterface $schemaValidator */
$schemaValidator = static::make(SchemaValidatorInterface::class);
return $schemaValidator->validate($schema);
}
/**
* @param Source $source
* @param array $options
* @return DocumentNode
*/
public static function parse(Source $source, array $options = []): DocumentNode
{
/** @var ParserInterface $parser */
$parser = static::make(ParserInterface::class);
return $parser->parse($source, $options);
}
/**
* @param Source $source
* @param array $options
* @return ValueNodeInterface
*/
public static function parseValue(Source $source, array $options = []): ValueNodeInterface
{
/** @var ParserInterface $parser */
$parser = static::make(ParserInterface::class);
return $parser->parseValue($source, $options);
}
/**
* @param Source $source
* @param array $options
* @return TypeNodeInterface
*/
public static function parseType(Source $source, array $options = []): TypeNodeInterface
{
/** @var ParserInterface $parser */
$parser = static::make(ParserInterface::class);
return $parser->parseType($source, $options);
}
/**
* @param Schema $schema
* @param DocumentNode $document
* @return array
*/
public static function validate(Schema $schema, DocumentNode $document): array
{
/** @var ValidatorInterface $validator */
$validator = static::make(ValidatorInterface::class);
return $validator->validate($schema, $document);
}
/**
* @param Schema $schema
* @param DocumentNode $document
* @param mixed $rootValue
* @param mixed $contextValue
* @param array $variableValues
* @param string|null $operationName
* @param callable|null $fieldResolver
* @param ErrorHandlerInterface|null $errorHandler
* @return PromiseInterface
*/
public static function execute(
Schema $schema,
DocumentNode $document,
$rootValue = null,
$contextValue = null,
array $variableValues = [],
$operationName = null,
callable $fieldResolver = null,
?ErrorHandlerInterface $errorHandler = null
): PromiseInterface {
/** @var ExecutionInterface $execution */
$execution = static::make(ExecutionInterface::class);
return $execution->execute(
$schema,
$document,
$rootValue,
$contextValue,
$variableValues,
$operationName,
$fieldResolver,
$errorHandler
);
}
/**
* @param Schema $schema
* @param string $source
* @param mixed $rootValue
* @param mixed $contextValue
* @param array $variableValues
* @param null|string $operationName
* @param callable|null $fieldResolver
* @param ErrorHandlerInterface|null $errorHandler
* @return PromiseInterface
* @throws InvariantException
*/
public static function process(
Schema $schema,
string $source,
$rootValue = null,
$contextValue = null,
array $variableValues = [],
?string $operationName = null,
?callable $fieldResolver = null,
?ErrorHandlerInterface $errorHandler = null
): PromiseInterface {
$schemaValidationErrors = validateSchema($schema);
if (!empty($schemaValidationErrors)) {
if (null !== $errorHandler) {
foreach ($schemaValidationErrors as $schemaValidationError) {
$errorHandler->handleError($schemaValidationError);
}
}
return resolve(new ExecutionResult(null, $schemaValidationErrors));
}
try {
$document = parse($source);
} catch (SyntaxErrorException $error) {
if (null !== $errorHandler) {
$errorHandler->handleError($error);
}
return resolve(new ExecutionResult(null, [$error]));
}
$validationErrors = validate($schema, $document);
if (!empty($validationErrors)) {
if (null !== $errorHandler) {
foreach ($validationErrors as $validationError) {
$errorHandler->handleError($validationError);
}
}
return resolve(new ExecutionResult(null, $validationErrors));
}
return executeAsync(
$schema,
$document,
$rootValue,
$contextValue,
$variableValues,
$operationName,
$fieldResolver,
$errorHandler
);
}
/**
* @param NodeInterface $node
* @return string
*/
public static function print(NodeInterface $node): string
{
/** @var NodePrinterInterface $nodePrinter */
$nodePrinter = static::make(NodePrinterInterface::class);
return $nodePrinter->print($node);
}
/**
* @return Container
*/
public function getContainer(): Container
{
return $this->container;
}
/**
* Registers the service provides with the container.
*
* @param Container $container
*/
protected function registerProviders(Container $container): void
{
foreach (self::$providers as $className) {
$container->addServiceProvider($className);
}
}
}
================================================
FILE: src/Language/DirectiveLocationEnum.php
================================================
<?php
namespace Digia\GraphQL\Language;
class DirectiveLocationEnum
{
// Request Definitions
public const QUERY = 'QUERY';
public const MUTATION = 'MUTATION';
public const SUBSCRIPTION = 'SUBSCRIPTION';
public const FIELD = 'FIELD';
public const FRAGMENT_DEFINITION = 'FRAGMENT_DEFINITION';
public const FRAGMENT_SPREAD = 'FRAGMENT_SPREAD';
public const INLINE_FRAGMENT = 'INLINE_FRAGMENT';
public const VARIABLE_DEFINITION = 'VARIABLE_DEFINITION';
// Type System Definitions
public const SCHEMA = 'SCHEMA';
public const SCALAR = 'SCALAR';
public const OBJECT = 'OBJECT';
public const FIELD_DEFINITION = 'FIELD_DEFINITION';
public const ARGUMENT_DEFINITION = 'ARGUMENT_DEFINITION';
public const INTERFACE = 'INTERFACE';
public const UNION = 'UNION';
public const ENUM = 'ENUM';
public const ENUM_VALUE = 'ENUM_VALUE';
public const INPUT_OBJECT = 'INPUT_OBJECT';
public const INPUT_FIELD_DEFINITION = 'INPUT_FIELD_DEFINITION';
/**
* @return array
* @throws \ReflectionException
*/
public static function values(): array
{
return array_values((new \ReflectionClass(__CLASS__))->getConstants());
}
}
================================================
FILE: src/Language/FileSourceBuilder.php
================================================
<?php
namespace Digia\GraphQL\Language;
use Digia\GraphQL\Error\FileNotFoundException;
use Digia\GraphQL\Error\InvariantException;
/**
* Class FileSourceBuilder
* @package Digia\GraphQL\Language
*/
class FileSourceBuilder implements SourceBuilderInterface
{
/**
* @var string
*/
private $filePath;
/**
* FileSourceBuilder constructor.
* @param string $filePath
*/
public function __construct(string $filePath)
{
$this->filePath = $filePath;
}
/**
* @inheritdoc
*
* @throws FileNotFoundException
* @throws InvariantException
*/
public function build(): Source
{
if (!\file_exists($this->filePath) || !\is_readable($this->filePath)) {
throw new FileNotFoundException(sprintf('The file %s cannot be found or is not readable', $this->filePath));
}
return new Source(\file_get_contents($this->filePath));
}
}
================================================
FILE: src/Language/KeywordEnum.php
================================================
<?php
namespace Digia\GraphQL\Language;
class KeywordEnum
{
public const SCHEMA = 'schema';
public const SCALAR = 'scalar';
public const TYPE = 'type';
public const INTERFACE = 'interface';
public const UNION = 'union';
public const ENUM = 'enum';
public const INPUT = 'input';
public const EXTEND = 'extend';
public const DIRECTIVE = 'directive';
public const ON = 'on';
public const FRAGMENT = 'fragment';
public const QUERY = 'query';
public const MUTATION = 'mutation';
public const SUBSCRIPTION = 'subscription';
public const TRUE = 'true';
public const FALSE = 'false';
/**
* @return array
* @throws \ReflectionException
*/
public static function values(): array
{
return array_values((new \ReflectionClass(__CLASS__))->getConstants());
}
}
================================================
FILE: src/Language/LanguageException.php
================================================
<?php
namespace Digia\GraphQL\Language;
use Digia\GraphQL\Error\AbstractException;
class LanguageException extends AbstractException
{
}
================================================
FILE: src/Language/LanguageProvider.php
================================================
<?php
namespace Digia\GraphQL\Language;
use League\Container\ServiceProvider\AbstractServiceProvider;
class LanguageProvider extends AbstractServiceProvider
{
/**
* @var array
*/
protected $provides = [
NodeBuilderInterface::class,
ParserInterface::class,
NodePrinterInterface::class,
];
/**
* @inheritdoc
*/
public function register()
{
$this->container->share(NodeBuilderInterface::class, NodeBuilder::class);
$this->container->share(NodePrinterInterface::class, NodePrinter::class);
$this->container->add(ParserInterface::class, Parser::class);
}
}
================================================
FILE: src/Language/Lexer.php
================================================
<?php
namespace Digia\GraphQL\Language;
/**
* A Lexer is a stateful stream generator in that every time
* it is advanced, it returns the next token in the Source. Assuming the
* source lexes, the final Token emitted by the lexer will be of kind
* EOF, after which the lexer will repeatedly return the same EOF token
* whenever called.
*/
class Lexer implements LexerInterface
{
protected const ENCODING = 'UTF-8';
/**
* A map between punctuation character code and the corresponding token kind.
*
* @var array
*/
protected static $codeTokenKindMap = [
33 => TokenKindEnum::BANG,
36 => TokenKindEnum::DOLLAR,
38 => TokenKindEnum::AMP,
40 => TokenKindEnum::PAREN_L,
41 => TokenKindEnum::PAREN_R,
58 => TokenKindEnum::COLON,
61 => TokenKindEnum::EQUALS,
64 => TokenKindEnum::AT,
91 => TokenKindEnum::BRACKET_L,
93 => TokenKindEnum::BRACKET_R,
123 => TokenKindEnum::BRACE_L,
124 => TokenKindEnum::PIPE,
125 => TokenKindEnum::BRACE_R,
];
/**
* The source file for this lexer.
*
* @var Source
*/
protected $source;
/**
* The contents of the source file.
*
* @var string
*/
protected $body;
/**
* The total number of characters in the source file.
*
* @var int
*/
protected $bodyLength;
/**
* The options for this lexer.
*
* @var array
*/
protected $options = [];
/**
* The previously focused non-ignored token.
*
* @var Token
*/
protected $lastToken;
/**
* The currently focused non-ignored token.
*
* @var Token
*/
protected $token;
/**
* The current position.
*
* @var int
*/
protected $position;
/**
* The (1-indexed) line containing the current token.
*
* @var int
*/
protected $line;
/**
* The character offset at which the current line begins.
*
* @var int
*/
protected $lineStart;
/**
* A key-value map over characters and their corresponding character codes.
*
* @var array
*/
protected static $charCodeCache = [];
/**
* Lexer constructor.
* @param Source $source
* @param array $options
*/
public function __construct(Source $source, array $options)
{
$startOfFileToken = $this->createStartOfFileToken();
$this->lastToken = $startOfFileToken;
$this->token = $startOfFileToken;
$this->line = 1;
$this->lineStart = 0;
$this->body = $source->getBody();
$this->bodyLength = \mb_strlen($this->body);
$this->source = $source;
$this->options = $options;
}
/**
* @inheritdoc
* @throws SyntaxErrorException
*/
public function advance(): Token
{
$this->lastToken = $this->token;
return $this->token = $this->lookahead();
}
/**
* @inheritdoc
* @throws SyntaxErrorException
*/
public function lookahead(): Token
{
$token = $this->token;
if (TokenKindEnum::EOF !== $token->getKind()) {
do {
$next = $this->readToken($token);
$token->setNext($next);
$token = $next;
} while (TokenKindEnum::COMMENT === $token->getKind());
}
return $token;
}
/**
* @inheritdoc
*/
public function getOption(string $name, $default = null)
{
return $this->options[$name] ?? $default;
}
/**
* @inheritdoc
*/
public function getSource(): Source
{
return $this->source;
}
/**
* @inheritdoc
*/
public function getToken(): Token
{
return $this->token;
}
/**
* @inheritdoc
*/
public function getLastToken(): Token
{
return $this->lastToken;
}
/**
* @inheritdoc
*/
public function createSyntaxErrorException(?string $description = null): SyntaxErrorException
{
return new SyntaxErrorException(
$this->source,
$this->position,
$description ?? $this->unexpectedCharacterMessage($this->readCharCode($this->position))
);
}
/**
* Reads the token after the given token.
*
* @param Token $prev
* @return Token
* @throws SyntaxErrorException
*/
protected function readToken(Token $prev): Token
{
$this->position = $prev->getEnd();
$this->skipWhitespace();
$line = $this->line;
$column = (1 + $this->position) - $this->lineStart;
if ($this->position >= $this->bodyLength) {
return $this->createEndOfFileToken($line, $column, $prev);
}
$code = $this->readCharCode($this->position);
// Punctuation: [!$&:=@|()\[\]{}]{1}
if (33 === $code || 36 === $code || 38 === $code || 58 === $code || 61 === $code || 64 === $code || 124 === $code ||
40 === $code || 41 === $code || 91 === $code || 93 === $code || 123 === $code || 125 === $code) {
return $this->lexPunctuation($code, $line, $column, $prev);
}
// Comment: #[\u0009\u0020-\uFFFF]*
if (35 === $code) {
return $this->lexComment($line, $column, $prev);
}
// Int: -?(0|[1-9][0-9]*)
// Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)?
if (45 === $code || isNumber($code)) {
return $this->lexNumber($code, $line, $column, $prev);
}
// Name: [_A-Za-z][_0-9A-Za-z]*
if (isAlphaNumeric($code)) {
return $this->lexName($line, $column, $prev);
}
// Spread: ...
if ($this->bodyLength >= 3 && $this->isSpread($code)) {
return $this->lexSpread($line, $column, $prev);
}
// String: "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*"
if ($this->isString($code)) {
return $this->lexString($line, $column, $prev);
}
// Block String: """("?"?(\\"""|\\(?!=""")|[^"\\]))*"""
if ($this->bodyLength >= 3 && $this->isTripleQuote($code)) {
return $this->lexBlockString($line, $column, $prev);
}
throw $this->createSyntaxErrorException();
}
/**
* @return Token
*/
protected function createStartOfFileToken(): Token
{
return new Token(TokenKindEnum::SOF);
}
/**
* Creates an End Of File (EOF) token.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
*/
protected function createEndOfFileToken(int $line, int $column, Token $prev): Token
{
return new Token(TokenKindEnum::EOF, $this->bodyLength, $this->bodyLength, $line, $column, $prev);
}
/**
* Reads a punctuation token from the source file.
*
* @param int $code
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
* @throws SyntaxErrorException
*/
protected function lexPunctuation(int $code, int $line, int $column, Token $prev): ?Token
{
if (!isset(self::$codeTokenKindMap[$code])) {
throw $this->createSyntaxErrorException();
}
return new Token(self::$codeTokenKindMap[$code], $this->position, $this->position + 1, $line, $column, $prev);
}
/**
* Reads a name token from the source file.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
*/
protected function lexName(int $line, int $column, Token $prev): Token
{
$start = $this->position;
++$this->position;
while ($this->position !== $this->bodyLength &&
($code = $this->readCharCode($this->position)) !== 0 &&
isAlphaNumeric($code)) {
++$this->position;
}
$value = sliceString($this->body, $start, $this->position);
return new Token(TokenKindEnum::NAME, $start, $this->position, $line, $column, $prev, $value);
}
/**
* Reads a number (int or float) token from the source file.
*
* @param int $code
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
* @throws SyntaxErrorException
*/
protected function lexNumber(int $code, int $line, int $column, Token $prev): Token
{
$start = $this->position;
$isFloat = false;
if (45 === $code) {
// -
$code = $this->readCharCode(++$this->position);
}
if (48 === $code) {
// 0
$code = $this->readCharCode(++$this->position);
if (isNumber($code)) {
throw $this->createSyntaxErrorException(
\sprintf('Invalid number, unexpected digit after 0: %s.', printCharCode($code))
);
}
} else {
$this->skipDigits($code);
$code = $this->readCharCode($this->position);
}
if (46 === $code) {
// .
$isFloat = true;
$code = $this->readCharCode(++$this->position);
$this->skipDigits($code);
$code = $this->readCharCode($this->position);
}
if (69 === $code || 101 === $code) {
// e or E
$isFloat = true;
$code = $this->readCharCode(++$this->position);
if (43 === $code || 45 === $code) {
// + or -
$code = $this->readCharCode(++$this->position);
}
$this->skipDigits($code);
}
return new Token(
$isFloat ? TokenKindEnum::FLOAT : TokenKindEnum::INT,
$start,
$this->position,
$line,
$column,
$prev,
sliceString($this->body, $start, $this->position)
);
}
/**
* Skips digits at the current position.
*
* @param int $code
* @throws SyntaxErrorException
*/
protected function skipDigits(int $code): void
{
if (isNumber($code)) {
do {
$code = $this->readCharCode(++$this->position);
} while (isNumber($code));
return;
}
throw $this->createSyntaxErrorException(
\sprintf('Invalid number, expected digit but got: %s.', printCharCode($code))
);
}
/**
* Reads a comment token from the source file.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
*/
protected function lexComment(int $line, int $column, Token $prev): Token
{
$start = $this->position;
do {
$code = $this->readCharCode(++$this->position);
} while ($code !== 0 && ($code > 0x001f || 0x0009 === $code)); // SourceCharacter but not LineTerminator
return new Token(
TokenKindEnum::COMMENT,
$start,
$this->position,
$line,
$column,
$prev,
sliceString($this->body, $start + 1, $this->position)
);
}
/**
* Reads a spread token from the source.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
*/
protected function lexSpread(int $line, int $column, Token $prev): Token
{
return new Token(TokenKindEnum::SPREAD, $this->position, $this->position + 3, $line, $column, $prev);
}
/**
* Reads a string token from the source.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
* @throws SyntaxErrorException
*/
protected function lexString(int $line, int $column, Token $prev): Token
{
$start = $this->position;
$chunkStart = ++$this->position; // skip the quote
$value = '';
while ($this->position < $this->bodyLength) {
$code = $this->readCharCode($this->position);
if (isLineTerminator($code)) {
break;
}
// Closing Quote (")
if (34 === $code) {
$value .= sliceString($this->body, $chunkStart, $this->position);
return new Token(TokenKindEnum::STRING, $start, $this->position + 1, $line, $column, $prev, $value);
}
if (isSourceCharacter($code)) {
throw $this->createSyntaxErrorException(
\sprintf('Invalid character within String: %s.', printCharCode($code))
);
}
++$this->position;
if (92 === $code) {
// \
$value .= sliceString($this->body, $chunkStart, $this->position - 1);
$code = $this->readCharCode($this->position);
switch ($code) {
case 34: // "
$value .= '"';
break;
case 47: // /
$value .= '/';
break;
case 92: // \
$value .= '\\';
break;
case 98: // b
$value .= '\b';
break;
case 102: // f
$value .= '\f';
break;
case 110: // n
$value .= '\n';
break;
case 114: // r
$value .= '\r';
break;
case 116: // t
$value .= '\t';
break;
case 117: // u
$unicodeString = sliceString($this->body, $this->position + 1, $this->position + 5);
if (!\preg_match('/[0-9A-Fa-f]{4}/', $unicodeString)) {
throw $this->createSyntaxErrorException(
\sprintf('Invalid character escape sequence: \\u%s.', $unicodeString)
);
}
$value .= '\\u' . $unicodeString;
$this->position += 4;
break;
default:
throw $this->createSyntaxErrorException(
\sprintf('Invalid character escape sequence: \\%s.', \chr($code))
);
}
++$this->position;
$chunkStart = $this->position;
}
}
throw $this->createSyntaxErrorException('Unterminated string.');
}
/**
* Reads a block string token from the source file.
*
* @param int $line
* @param int $column
* @param Token $prev
* @return Token
* @throws SyntaxErrorException
*/
protected function lexBlockString(int $line, int $column, Token $prev): Token
{
$start = $this->position;
$this->position = $start + 3; // skip the triple-quote
$chunkStart = $this->position;
$rawValue = '';
while ($this->position < $this->bodyLength) {
$code = $this->readCharCode($this->position);
// Closing Triple-Quote (""")
if ($this->isTripleQuote($code)) {
$rawValue .= sliceString($this->body, $chunkStart, $this->position);
return new Token(
TokenKindEnum::BLOCK_STRING,
$start,
$this->position + 3,
$line,
$column,
$prev,
blockStringValue($rawValue)
);
}
if (isSourceCharacter($code) && !isLineTerminator($code)) {
throw $this->createSyntaxErrorException(
\sprintf('Invalid character within String: %s.', printCharCode($code))
);
}
if ($this->isEscapedTripleQuote($code)) {
$rawValue .= sliceString($this->body, $chunkStart, $this->position) . '"""';
$this->position += 4;
$chunkStart = $this->position;
} else {
++$this->position;
}
}
throw $this->createSyntaxErrorException('Unterminated string.');
}
/**
* Skips whitespace at the current position.
*/
protected function skipWhitespace(): void
{
while ($this->position < $this->bodyLength) {
$code = $this->readCharCode($this->position);
if (9 === $code || 32 === $code || 44 === $code || 0xfeff === $code) {
// tab | space | comma | BOM
++$this->position;
} elseif (10 === $code) {
// new line (\n)
++$this->position;
++$this->line;
$this->lineStart = $this->position;
} elseif (13 === $code) {
// carriage return (\r)
if (10 === $this->readCharCode($this->position + 1)) {
// carriage return and new line (\r\n)
$this->position += 2;
} else {
++$this->position;
}
++$this->line;
$this->lineStart = $this->position;
} else {
break;
}
}
}
/**
* @param int $position
* @return int
*/
protected function readCharCode(int $position): int
{
$char = \mb_substr($this->body, $position, 1, self::ENCODING);
if ('' === $char) {
return 0;
}
if (!isset(self::$charCodeCache[$char])) {
$code = \ord($char);
if ($code >= 128) {
$code = \mb_ord($char, self::ENCODING);
}
self::$charCodeCache[$char] = $code;
}
return self::$charCodeCache[$char];
}
/**
* Report a message that an unexpected character was encountered.
*
* @param int $code
* @return string
*/
protected function unexpectedCharacterMessage(int $code): string
{
if (isSourceCharacter($code) && !isLineTerminator($code)) {
return \sprintf('Cannot contain the invalid character %s.', printCharCode($code));
}
if ($code === 39) {
// '
return 'Unexpected single quote character (\'), did you mean to use a double quote (")?';
}
return \sprintf('Cannot parse the unexpected character %s.', printCharCode($code));
}
/**
* @param int $code
* @return bool
*/
protected function isSpread(int $code): bool
{
return 46 === $code &&
$this->readCharCode($this->position + 1) === 46 &&
$this->readCharCode($this->position + 2) === 46; // ...
}
/**
* @param int $code
* @return bool
*/
protected function isString(int $code): bool
{
return 34 === $code && $this->readCharCode($this->position + 1) !== 34;
}
/**
* @param int $code
* @return bool
*/
protected function isTripleQuote(int $code): bool
{
return 34 === $code &&
34 === $this->readCharCode($this->position + 1) &&
34 === $this->readCharCode($this->position + 2); // """
}
/**
* @param int $code
* @return bool
*/
protected function isEscapedTripleQuote(int $code): bool
{
return $code === 92 &&
34 === $this->readCharCode($this->position + 1) &&
34 === $this->readCharCode($this->position + 2) &&
34 === $this->readCharCode($this->position + 3); // \"""
}
}
================================================
FILE: src/Language/LexerInterface.php
================================================
<?php
namespace Digia\GraphQL\Language;
interface LexerInterface
{
/**
* Advances the token stream to the next non-ignored token.
*
* @return Token
*/
public function advance(): Token;
/**
* Looks ahead and returns the next non-ignored token, but does not change
* the Lexer's state.
*
* @return Token
*/
public function lookahead(): Token;
/**
* Returns an option given to this Lexer by its name.
*
* @param string $name
* @param mixed|null $default
* @return mixed
*/
public function getOption(string $name, $default = null);
/**
* Returns the source lexed by this Lexer.
*
* @return Source
*/
public function getSource(): Source;
/**
* Returns the token at the Lexer's current position.
*
* @return Token
*/
public function getToken(): Token;
/**
* Returns the previous focused token for this Lexer.
*
* @return Token
*/
public function getLastToken(): Token;
/**
* Creates a `SyntaxErrorException` for the current position in the source file.
*
* @param null|string $description
* @return SyntaxErrorException
*/
public function createSyntaxErrorException(?string $description = null): SyntaxErrorException;
}
================================================
FILE: src/Language/Location.php
================================================
<?php
namespace Digia\GraphQL\Language;
use Digia\GraphQL\Util\ArrayToJsonTrait;
use Digia\GraphQL\Util\SerializationInterface;
class Location implements SerializationInterface
{
use ArrayToJsonTrait;
/**
* @var int
*/
protected $start;
/**
* @var int
*/
protected $end;
/**
* @var Source|null
*/
protected $source;
/**
* Location constructor.
*
* @param int $start
* @param int $end
* @param Source|null $source
*/
public function __construct(int $start, int $end, ?Source $source = null)
{
$this->start = $start;
$this->end = $end;
$this->source = $source;
}
/**
* @return int
*/
public function getStart(): int
{
return $this->start;
}
/**
* @return int
*/
public function getEnd(): int
{
return $this->end;
}
/**
* @return Source|null
*/
public function getSource(): ?Source
{
return $this->source;
}
/**
* @return array
*/
public function toArray(): array
{
return [
'start' => $this->start,
'end' => $this->end,
];
}
/**
* @return string
*/
public function __toString(): string
{
return $this->toJSON();
}
}
================================================
FILE: src/Language/MultiFileSourceBuilder.php
================================================
<?php
namespace Digia\GraphQL\Language;
use Digia\GraphQL\Error\FileNotFoundException;
use Digia\GraphQL\Error\InvariantException;
/**
* Class MultiFileSourceBuilder
* @package Digia\GraphQL\Language
*/
class MultiFileSourceBuilder implements SourceBuilderInterface
{
/**
* @var string[]
*/
private $filePaths;
/**
* MultiFileSourceBuilder constructor.
* @param string[] $filePaths
*/
public function __construct(array $filePaths)
{
$this->filePaths = $filePaths;
}
/**
* @inheritdoc
*
* @throws FileNotFoundException
* @throws InvariantException
*/
public function build(): Source
{
$combinedSource = '';
foreach ($this->filePaths as $filePath) {
if (!\file_exists($filePath) || !\is_readable($filePath)) {
throw new FileNotFoundException(sprintf('The file %s cannot be found or is not readable', $filePath));
}
$combinedSource .= \file_get_contents($filePath);
}
return new Source($combinedSource);
}
}
================================================
FILE: src/Language/Node/ASTNodeAwareInterface.php
================================================
<?php
namespace Digia\GraphQL\Language\Node;
interface ASTNodeAwareInterface
{
/**
* @return bool
*/
public function hasAstNode(): bool;
/**
* @return NodeInterface|null
*/
public function getAstNode(): ?NodeInterface;
}
================================================
FILE: src/Language/Node/ASTNodeTrait.php
================================================
<?php
namespace Digia\GraphQL\Language\Node;
trait ASTNodeTrait
{
/**
* @var ?NodeInterface
*/
protected $astNode;
/**
* @return bool
*/
public function hasAstNode(): bool
{
return null !== $this->astNode;
}
/**
* @return NodeInterface|null
*/
public function getAstNode(): ?NodeInterface
{
return $this->astNode;
}
/**
* @param NodeInterface|null $astNode
* @return $this
*/
protected function setAstNode(?NodeInterface $astNode)
{
$this->astNode = $astNode;
return $this;
}
}
================================================
FILE: src/Language/Node/AbstractNode.php
================================================
<?php
namespace Digia\GraphQL\Language\Node;
use Digia\GraphQL\GraphQL;
use Digia\GraphQL\Language\Location;
use Digia\GraphQL\Language\NodeBuilderInterface;
use Digia\GraphQL\Language\Visitor\VisitorBreak;
use Digia\GraphQL\Language\Visitor\VisitorInfo;
use Digia\GraphQL\Language\Visitor\VisitorResult;
use Digia\GraphQL\Util\ArrayToJsonTrait;
use Digia\GraphQL\Util\NodeComparator;
use Digia\GraphQL\Util\SerializationInterface;
abstract class AbstractNode implements NodeInterface, SerializationInterface
{
use ArrayToJsonTrait;
/**
* @var string
*/
protected $kind;
/**
* @var Location|null
*/
protected $location;
/**
* @var VisitorInfo|null
*/
protected $visitorInfo;
/**
* @var bool
*/
protected $isEdited = false;
/**
* @var NodeBuilderInterface
*/
private static $nodeBuilder;
/**
* @return array
*/
abstract public function toAST(): array;
/**
* AbstractNode constructor.
*
* @param string $kind
* @param Location|null $location
*/
public function __construct(string $kind, ?Location $location)
{
$this->kind = $kind;
$this->location = $location;
}
/**
* @return string
*/
public function getKind(): string
{
return $this->kind;
}
/**
* @return bool
*/
public function hasLocation(): bool
{
return null !== $this->location;
}
/**
* @return Location|null
*/
public function getLocation(): ?Location
{
return $this->location;
}
/**
* @return array|null
*/
public function getLocationAST(): ?array
{
return null !== $this->location
? $this->location->toArray()
: null;
}
/**
* @return array
*/
public function toArray(): array
{
return $this->toAST();
}
/**
* @return string
*/
public function __toString(): string
{
return $this->toJSON();
}
/**
* @inheritdoc
*/
public function acceptVisitor(VisitorInfo $visitorInfo): ?NodeInterface
{
$this->visitorInfo = $visitorInfo;
$visitor = $this->visitorInfo->getVisitor();
$VisitorResult = $visitor->enterNode(clone $this);
$newNode = $VisitorResult->getValue();
// Handle early exit while entering
if ($VisitorResult->getAction() === VisitorResult::ACTION_BREAK) {
/** @noinspection PhpUnhandledExceptionInspection */
throw new VisitorBreak();
}
// If the result was null, it means that we should not traverse this branch.
if (null === $newNode) {
return null;
}
// If the node was edited, we want to return early to avoid visiting its sub-tree completely.
if ($newNode->determineIsEdited($this)) {
return $newNode;
}
foreach (self::$kindToNodesToVisitMap[$this->kind] as $property) {
$nodeOrNodes = $this->{$property};
if (empty($nodeOrNodes)) {
continue;
}
$newNodeOrNodes = $this->visitNodeOrNodes($nodeOrNodes, $property, $newNode);
if (empty($newNodeOrNodes)) {
continue;
}
$setter = 'set' . \ucfirst($property);
if (\method_exists($newNode, $setter)) {
$newNode->{$setter}($newNodeOrNodes);
}
}
$VisitorResult = $visitor->leaveNode($newNode);
// Handle early exit while leaving
if ($VisitorResult->getAction() === VisitorResult::ACTION_BREAK) {
/** @noinspection PhpUnhandledExceptionInspection */
throw new VisitorBreak();
}
return $VisitorResult->getValue();
}
/**
* @return VisitorInfo|null
*/
public function getVisitorInfo(): ?VisitorInfo
{
return $this->visitorInfo;
}
/**
* @inheritdoc
*/
public function determineIsEdited(NodeInterface $node): bool
{
return $this->isEdited = $this->isEdited() || !NodeComparator::compare($this, $node);
}
/**
* @inheritdoc
*/
public function getAncestor(int $depth = 1): ?NodeInterface
{
return null !== $this->visitorInfo ? $this->visitorInfo->getAncestor($depth) : null;
}
/**
* @return bool
*/
public function isEdited(): bool
{
return $this->isEdited;
}
/**
* @param NodeInterface|NodeInterface[] $nodeOrNodes
* @param mixed $key
* @param NodeInterface $parent
* @return NodeInterface|NodeInterface[]|null
*/
protected function visitNodeOrNodes($nodeOrNodes, $key, NodeInterface $parent)
{
$this->visitorInfo->addAncestor($parent);
$newNodeOrNodes = \is_array($nodeOrNodes)
? $this->visitNodes($nodeOrNodes, $key)
: $this->visitNode($nodeOrNodes, $key, $parent);
$this->visitorInfo->removeAncestor();
return $newNodeOrNodes;
}
/**
* @param NodeInterface[] $nodes
* @param string|int $key
* @return NodeInterface[]
*/
protected function visitNodes(array $nodes, $key): array
{
$this->visitorInfo->addOneToPath($key);
$index = 0;
$newNodes = [];
foreach ($nodes as $node) {
$newNode = $this->visitNode($node, $index, null);
if (null !== $newNode) {
$newNodes[$index] = $newNode;
$index++;
}
}
$this->visitorInfo->removeOneFromPath();
return $newNodes;
}
/**
* @param NodeInterface $node
* @param string|int $key
* @param NodeInterface|null $parent
* @return NodeInterface|null
*/
protected function visitNode(NodeInterface $node, $key, ?NodeInterface $parent): ?NodeInterface
{
$this->visitorInfo->addOneToPath($key);
$info = new VisitorInfo(
$this->visitorInfo->getVisitor(),
$key,
$parent,
$this->visitorInfo->getPath(),
$this->visitorInfo->getAncestors()
);
$newNode = $node->acceptVisitor($info);
// If the node was edited, we need to revisit it to produce the expected result.
if (null !== $newNode && $newNode->isEdited()) {
$newNode = $newNode->acceptVisitor($info);
}
$this->visitorInfo->removeOneFromPath();
return $newNode;
}
/**
* @param NodeInterface $other
* @return bool
*/
protected function compareNode(NodeInterface $other)
{
return $this->toJSON() === $other->toJSON();
}
/**
* @return NodeBuilderInterface
*/
protected function getNodeBuilder(): NodeBuilderInterface
{
if (null === self::$nodeBuilder) {
self::$nodeBuilder = GraphQL::make(NodeBuilderInterface::class);
}
return self::$nodeBuilder;
}
/**
* @var array
*/
protected static $kindToNodesToVisitMap = [
'Name' => [],
'Document' => ['definitions'],
'OperationDefinition' => [
'name',
'variableDefinitions',
'directives',
'selectionSet',
],
'VariableDefinition' => ['variable', 'type', 'defaultValue'],
'Variable' => ['name'],
'SelectionSet' => ['selections'],
'Field' => ['alias', 'name', 'arguments', 'directives', 'selectionSet'],
'Argument' => ['name', 'value'],
'FragmentSpread' => ['name', 'directives'],
'InlineFragment' => ['typeCondition', 'directives', 'selectionSet'],
'FragmentDefinition' => [
'name',
'variableDefinitions',
'typeCondition',
'directives',
'selectionSet',
],
'IntValue' => [],
'FloatValue' => [],
'StringValue' => [],
'BooleanValue' => [],
'NullValue' => [],
'EnumValue' => [],
'ListValue' => ['values'],
'ObjectValue' => ['fields'],
'ObjectField' => ['name', 'value'],
'Directive' => ['name', 'arguments'],
'NamedType' => ['name'],
'ListType' => ['type'],
'NonNullType' => ['type'],
'SchemaDefinition' => ['directives', 'operationTypes'],
'OperationTypeDefinition' => ['type'],
'ScalarTypeDefinition' => ['description', 'name', 'directives'],
'ObjectTypeDefinition' => [
'description',
'name',
'interfaces',
'directives',
'fields',
],
'FieldDefinition' => ['description', 'name', 'arguments', 'type', 'directives'],
'InputValueDefinition' => [
'description',
'name',
'type',
'defaultValue',
'directives',
],
'InterfaceTypeDefinition' => ['description', 'name', 'directives', 'fields'],
'UnionTypeDefinition' => ['description', 'name', 'directives', 'types'],
'EnumTypeDefinition' => ['description', 'name', 'directives', 'values'],
'EnumValueDefinition' => ['description', 'name', 'directives'],
'InputObjectTypeDefinition' => ['description', 'name', 'directives', 'fields'],
'DirectiveDefinition' => ['description', 'name', 'arguments', 'locations'],
'SchemaExtension' => ['directives', 'operationTypes'],
'ScalarTypeExtension' => ['name', 'directives'],
'ObjectTypeExtension' => ['name', 'interfaces', 'directives', 'fields'],
'InterfaceTypeExtension' => ['name', 'directives', 'fields'],
'UnionTypeExtension' => ['name', 'directives', 'types'],
'EnumTypeExtension' => ['name', 'directives', 'values'],
'InputObjectTypeExtension' => ['name', 'directives', 'fields'],
];
}
================================================
FILE: src/Language/Node/AliasTrait.php
=
gitextract_sov667i9/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ └── test.yml
├── .gitignore
├── .idea/
│ ├── codeStyles/
│ │ ├── Project.xml
│ │ └── codeStyleConfig.xml
│ ├── graphql-php.iml
│ ├── inspectionProfiles/
│ │ └── Project_Default.xml
│ ├── modules.xml
│ ├── php.xml
│ └── vcs.xml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── composer.json
├── phpunit.xml.dist
├── src/
│ ├── Error/
│ │ ├── AbstractException.php
│ │ ├── FileNotFoundException.php
│ │ ├── GraphQLException.php
│ │ ├── Handler/
│ │ │ ├── AbstractErrorMiddleware.php
│ │ │ ├── CallableMiddleware.php
│ │ │ ├── ErrorHandler.php
│ │ │ ├── ErrorHandlerInterface.php
│ │ │ └── ErrorMiddlewareInterface.php
│ │ ├── InvalidTypeException.php
│ │ ├── InvariantException.php
│ │ └── helpers.php
│ ├── Execution/
│ │ ├── CoercedValue.php
│ │ ├── Execution.php
│ │ ├── ExecutionContext.php
│ │ ├── ExecutionException.php
│ │ ├── ExecutionInterface.php
│ │ ├── ExecutionProvider.php
│ │ ├── ExecutionResult.php
│ │ ├── InvalidReturnTypeException.php
│ │ ├── Path.php
│ │ ├── ResolveInfo.php
│ │ ├── Strategy/
│ │ │ ├── AbstractExecutionStrategy.php
│ │ │ ├── ExecutionStrategyInterface.php
│ │ │ ├── FieldCollector.php
│ │ │ ├── ParallelExecutionStrategy.php
│ │ │ └── SerialExecutionStrategy.php
│ │ ├── UndefinedFieldException.php
│ │ └── ValuesResolver.php
│ ├── GraphQL.php
│ ├── Language/
│ │ ├── DirectiveLocationEnum.php
│ │ ├── FileSourceBuilder.php
│ │ ├── KeywordEnum.php
│ │ ├── LanguageException.php
│ │ ├── LanguageProvider.php
│ │ ├── Lexer.php
│ │ ├── LexerInterface.php
│ │ ├── Location.php
│ │ ├── MultiFileSourceBuilder.php
│ │ ├── Node/
│ │ │ ├── ASTNodeAwareInterface.php
│ │ │ ├── ASTNodeTrait.php
│ │ │ ├── AbstractNode.php
│ │ │ ├── AliasTrait.php
│ │ │ ├── ArgumentNode.php
│ │ │ ├── ArgumentsAwareInterface.php
│ │ │ ├── ArgumentsTrait.php
│ │ │ ├── BooleanValueNode.php
│ │ │ ├── DefaultValueTrait.php
│ │ │ ├── DefinitionNodeInterface.php
│ │ │ ├── DescriptionTrait.php
│ │ │ ├── DirectiveDefinitionNode.php
│ │ │ ├── DirectiveNode.php
│ │ │ ├── DirectivesAwareInterface.php
│ │ │ ├── DirectivesTrait.php
│ │ │ ├── DocumentNode.php
│ │ │ ├── EnumTypeDefinitionNode.php
│ │ │ ├── EnumTypeExtensionNode.php
│ │ │ ├── EnumValueDefinitionNode.php
│ │ │ ├── EnumValueNode.php
│ │ │ ├── EnumValuesTrait.php
│ │ │ ├── ExecutableDefinitionNodeInterface.php
│ │ │ ├── FieldDefinitionNode.php
│ │ │ ├── FieldNode.php
│ │ │ ├── FieldsTrait.php
│ │ │ ├── FloatValueNode.php
│ │ │ ├── FragmentDefinitionNode.php
│ │ │ ├── FragmentNodeInterface.php
│ │ │ ├── FragmentSpreadNode.php
│ │ │ ├── InlineFragmentNode.php
│ │ │ ├── InputArgumentsTrait.php
│ │ │ ├── InputFieldsTrait.php
│ │ │ ├── InputObjectTypeDefinitionNode.php
│ │ │ ├── InputObjectTypeExtensionNode.php
│ │ │ ├── InputValueDefinitionNode.php
│ │ │ ├── IntValueNode.php
│ │ │ ├── InterfaceTypeDefinitionNode.php
│ │ │ ├── InterfaceTypeExtensionNode.php
│ │ │ ├── InterfacesTrait.php
│ │ │ ├── ListTypeNode.php
│ │ │ ├── ListValueNode.php
│ │ │ ├── NameAwareInterface.php
│ │ │ ├── NameNode.php
│ │ │ ├── NameTrait.php
│ │ │ ├── NamedTypeNode.php
│ │ │ ├── NamedTypeNodeInterface.php
│ │ │ ├── NodeInterface.php
│ │ │ ├── NodeKindEnum.php
│ │ │ ├── NonNullTypeNode.php
│ │ │ ├── NullValueNode.php
│ │ │ ├── ObjectFieldNode.php
│ │ │ ├── ObjectTypeDefinitionNode.php
│ │ │ ├── ObjectTypeExtensionNode.php
│ │ │ ├── ObjectValueNode.php
│ │ │ ├── OperationDefinitionNode.php
│ │ │ ├── OperationTypeDefinitionNode.php
│ │ │ ├── ScalarTypeDefinitionNode.php
│ │ │ ├── ScalarTypeExtensionNode.php
│ │ │ ├── SchemaDefinitionNode.php
│ │ │ ├── SchemaExtensionNode.php
│ │ │ ├── SelectionNodeInterface.php
│ │ │ ├── SelectionSetAwareInterface.php
│ │ │ ├── SelectionSetNode.php
│ │ │ ├── SelectionSetTrait.php
│ │ │ ├── StringValueNode.php
│ │ │ ├── TypeConditionTrait.php
│ │ │ ├── TypeNodeInterface.php
│ │ │ ├── TypeSystemDefinitionNodeInterface.php
│ │ │ ├── TypeSystemExtensionNodeInterface.php
│ │ │ ├── TypeTrait.php
│ │ │ ├── TypesTrait.php
│ │ │ ├── UnionTypeDefinitionNode.php
│ │ │ ├── UnionTypeExtensionNode.php
│ │ │ ├── ValueAwareInterface.php
│ │ │ ├── ValueLiteralTrait.php
│ │ │ ├── ValueNodeInterface.php
│ │ │ ├── ValueTrait.php
│ │ │ ├── VariableDefinitionNode.php
│ │ │ ├── VariableDefinitionsAwareInterface.php
│ │ │ ├── VariableDefinitionsTrait.php
│ │ │ └── VariableNode.php
│ │ ├── NodeBuilder.php
│ │ ├── NodeBuilderInterface.php
│ │ ├── NodePrinter.php
│ │ ├── NodePrinterInterface.php
│ │ ├── Parser.php
│ │ ├── ParserInterface.php
│ │ ├── PrintException.php
│ │ ├── Source.php
│ │ ├── SourceBuilderInterface.php
│ │ ├── SourceLocation.php
│ │ ├── StringSourceBuilder.php
│ │ ├── SyntaxErrorException.php
│ │ ├── Token.php
│ │ ├── TokenKindEnum.php
│ │ ├── Visitor/
│ │ │ ├── ParallelVisitor.php
│ │ │ ├── SpecificKindVisitor.php
│ │ │ ├── TypeInfoVisitor.php
│ │ │ ├── Visitor.php
│ │ │ ├── VisitorBreak.php
│ │ │ ├── VisitorInfo.php
│ │ │ ├── VisitorInterface.php
│ │ │ └── VisitorResult.php
│ │ ├── blockStringValue.php
│ │ └── utils.php
│ ├── Schema/
│ │ ├── Building/
│ │ │ ├── BuildInfo.php
│ │ │ ├── BuildingContext.php
│ │ │ ├── BuildingContextInterface.php
│ │ │ ├── SchemaBuilder.php
│ │ │ ├── SchemaBuilderInterface.php
│ │ │ ├── SchemaBuildingException.php
│ │ │ └── SchemaBuildingProvider.php
│ │ ├── DefinitionBuilder.php
│ │ ├── DefinitionBuilderInterface.php
│ │ ├── DefinitionInterface.php
│ │ ├── DefinitionPrinter.php
│ │ ├── DefinitionPrinterInterface.php
│ │ ├── Extension/
│ │ │ ├── ExtendInfo.php
│ │ │ ├── ExtensionContext.php
│ │ │ ├── ExtensionContextInterface.php
│ │ │ ├── SchemaExtender.php
│ │ │ ├── SchemaExtenderInterface.php
│ │ │ ├── SchemaExtensionException.php
│ │ │ └── SchemaExtensionProvider.php
│ │ ├── Resolver/
│ │ │ ├── AbstractFieldResolver.php
│ │ │ ├── AbstractTypeResolver.php
│ │ │ ├── ResolverCollectionInterface.php
│ │ │ ├── ResolverInterface.php
│ │ │ ├── ResolverMap.php
│ │ │ ├── ResolverMiddlewareInterface.php
│ │ │ ├── ResolverRegistry.php
│ │ │ ├── ResolverRegistryInterface.php
│ │ │ └── ResolverTrait.php
│ │ ├── Schema.php
│ │ ├── Validation/
│ │ │ ├── Rule/
│ │ │ │ ├── AbstractRule.php
│ │ │ │ ├── DirectivesRule.php
│ │ │ │ ├── RootTypesRule.php
│ │ │ │ ├── RuleInterface.php
│ │ │ │ ├── SupportedRules.php
│ │ │ │ └── TypesRule.php
│ │ │ ├── SchemaValidationException.php
│ │ │ ├── SchemaValidationProvider.php
│ │ │ ├── SchemaValidator.php
│ │ │ ├── SchemaValidatorInterface.php
│ │ │ ├── ValidationContext.php
│ │ │ └── ValidationContextInterface.php
│ │ └── utils.php
│ ├── Type/
│ │ ├── Coercer/
│ │ │ ├── AbstractCoercer.php
│ │ │ ├── BooleanCoercer.php
│ │ │ ├── CoercerInterface.php
│ │ │ ├── CoercingException.php
│ │ │ ├── FloatCoercer.php
│ │ │ ├── IntCoercer.php
│ │ │ └── StringCoercer.php
│ │ ├── CoercerProvider.php
│ │ ├── Definition/
│ │ │ ├── AbstractTypeInterface.php
│ │ │ ├── Argument.php
│ │ │ ├── ArgumentsAwareInterface.php
│ │ │ ├── ArgumentsTrait.php
│ │ │ ├── CompositeTypeInterface.php
│ │ │ ├── DefaultValue.php
│ │ │ ├── DefaultValueTrait.php
│ │ │ ├── DeprecationAwareInterface.php
│ │ │ ├── DeprecationTrait.php
│ │ │ ├── DescriptionAwareInterface.php
│ │ │ ├── DescriptionTrait.php
│ │ │ ├── Directive.php
│ │ │ ├── EnumType.php
│ │ │ ├── EnumValue.php
│ │ │ ├── ExtensionASTNodesTrait.php
│ │ │ ├── Field.php
│ │ │ ├── FieldInterface.php
│ │ │ ├── FieldsAwareInterface.php
│ │ │ ├── FieldsTrait.php
│ │ │ ├── InputField.php
│ │ │ ├── InputObjectType.php
│ │ │ ├── InputTypeInterface.php
│ │ │ ├── InputValueInterface.php
│ │ │ ├── InterfaceType.php
│ │ │ ├── LeafTypeInterface.php
│ │ │ ├── ListType.php
│ │ │ ├── NameTrait.php
│ │ │ ├── NamedTypeInterface.php
│ │ │ ├── NonNullType.php
│ │ │ ├── ObjectType.php
│ │ │ ├── OfTypeTrait.php
│ │ │ ├── OutputTypeInterface.php
│ │ │ ├── ResolveTrait.php
│ │ │ ├── ResolveTypeTrait.php
│ │ │ ├── ScalarType.php
│ │ │ ├── SerializableTypeInterface.php
│ │ │ ├── SpecifiedDirectiveEnum.php
│ │ │ ├── TypeInterface.php
│ │ │ ├── TypeNameEnum.php
│ │ │ ├── TypeTrait.php
│ │ │ ├── UnionType.php
│ │ │ ├── ValueTrait.php
│ │ │ └── WrappingTypeInterface.php
│ │ ├── DirectivesProvider.php
│ │ ├── IntrospectionProvider.php
│ │ ├── ScalarTypesProvider.php
│ │ ├── TypeKindEnum.php
│ │ ├── definition.php
│ │ ├── directives.php
│ │ ├── introspection.php
│ │ └── scalars.php
│ ├── Util/
│ │ ├── AbstractEnum.php
│ │ ├── ArrayToJsonTrait.php
│ │ ├── ConversionException.php
│ │ ├── NameHelper.php
│ │ ├── NodeComparator.php
│ │ ├── SerializationInterface.php
│ │ ├── TypeASTConverter.php
│ │ ├── TypeHelper.php
│ │ ├── TypeInfo.php
│ │ ├── ValueASTConverter.php
│ │ ├── ValueConverter.php
│ │ ├── ValueHelper.php
│ │ └── utils.php
│ ├── Validation/
│ │ ├── Conflict/
│ │ │ ├── ComparisonContext.php
│ │ │ ├── Conflict.php
│ │ │ ├── ConflictFinder.php
│ │ │ ├── FieldContext.php
│ │ │ └── PairSet.php
│ │ ├── Rule/
│ │ │ ├── AbstractRule.php
│ │ │ ├── ExecutableDefinitionsRule.php
│ │ │ ├── FieldOnCorrectTypeRule.php
│ │ │ ├── FragmentsOnCompositeTypesRule.php
│ │ │ ├── KnownArgumentNamesRule.php
│ │ │ ├── KnownDirectivesRule.php
│ │ │ ├── KnownFragmentNamesRule.php
│ │ │ ├── KnownTypeNamesRule.php
│ │ │ ├── LoneAnonymousOperationRule.php
│ │ │ ├── NoFragmentCyclesRule.php
│ │ │ ├── NoUndefinedVariablesRule.php
│ │ │ ├── NoUnusedFragmentsRule.php
│ │ │ ├── NoUnusedVariablesRule.php
│ │ │ ├── OverlappingFieldsCanBeMergedRule.php
│ │ │ ├── PossibleFragmentSpreadsRule.php
│ │ │ ├── ProvidedRequiredArgumentsRule.php
│ │ │ ├── RuleInterface.php
│ │ │ ├── ScalarLeafsRule.php
│ │ │ ├── SingleFieldSubscriptionsRule.php
│ │ │ ├── SupportedRules.php
│ │ │ ├── UniqueArgumentNamesRule.php
│ │ │ ├── UniqueDirectivesPerLocationRule.php
│ │ │ ├── UniqueFragmentNamesRule.php
│ │ │ ├── UniqueInputFieldNamesRule.php
│ │ │ ├── UniqueOperationNamesRule.php
│ │ │ ├── UniqueVariableNamesRule.php
│ │ │ ├── ValuesOfCorrectTypeRule.php
│ │ │ ├── VariablesAreInputTypesRule.php
│ │ │ ├── VariablesDefaultValueAllowedRule.php
│ │ │ └── VariablesInAllowedPositionRule.php
│ │ ├── RulesProvider.php
│ │ ├── ValidationContext.php
│ │ ├── ValidationContextAwareTrait.php
│ │ ├── ValidationContextInterface.php
│ │ ├── ValidationException.php
│ │ ├── ValidationExceptionInterface.php
│ │ ├── ValidationProvider.php
│ │ ├── Validator.php
│ │ ├── ValidatorInterface.php
│ │ └── messages.php
│ └── api.php
└── tests/
├── Functional/
│ ├── Execution/
│ │ ├── AbstractPromiseTest.php
│ │ ├── AbstractTest.php
│ │ ├── DeferredResolverTest.php
│ │ ├── DirectivesTest.php
│ │ ├── ExecutionTest.php
│ │ ├── ListTest.php
│ │ ├── MutationTest.php
│ │ ├── NonNullTest.php
│ │ ├── ResolveTest.php
│ │ ├── SchemaTest.php
│ │ ├── UnionInterfaceTest.php
│ │ ├── ValuesResolverTest.php
│ │ ├── VariablesTest.php
│ │ └── testClasses.php
│ ├── IntrospectionTest.php
│ ├── Language/
│ │ ├── FileSourceBuilderTest.php
│ │ ├── MultiFileSourceBuilderTest.php
│ │ ├── ParserTest.php
│ │ ├── SchemaParserTest.php
│ │ ├── SchemaPrinterTest.php
│ │ ├── StringSourceBuilderTest.php
│ │ ├── VisitorTest.php
│ │ ├── kitchen-sink.graphql
│ │ └── schema-kitchen-sink.graphqls
│ ├── QueryTest.php
│ ├── Schema/
│ │ ├── BuildingTest.php
│ │ ├── DefinitionPrinterTest.php
│ │ ├── ExtensionTest.php
│ │ ├── SchemaBuilderTest.php
│ │ ├── SchemaTest.php
│ │ └── ValidationTest.php
│ ├── Type/
│ │ ├── DefinitionTest.php
│ │ ├── EnumTypeTest.php
│ │ ├── IntrospectionTest.php
│ │ ├── PredicateTest.php
│ │ ├── SerializationTest.php
│ │ └── introspection.graphql
│ ├── Validation/
│ │ ├── MessagesTest.php
│ │ ├── Rule/
│ │ │ ├── ExecutableDefinitionsRuleTest.php
│ │ │ ├── FieldOnCorrectTypeRuleTest.php
│ │ │ ├── FragmentsOnCompositeTypesRuleTest.php
│ │ │ ├── KnownArgumentNamesRuleTest.php
│ │ │ ├── KnownDirectivesRuleTest.php
│ │ │ ├── KnownFragmentNamesRuleTest.php
│ │ │ ├── KnownTypeNamesRuleTest.php
│ │ │ ├── LoneAnonymousOperationRuleTest.php
│ │ │ ├── NoFragmentCyclesRuleTest.php
│ │ │ ├── NoUndefinedVariablesRuleTest.php
│ │ │ ├── NoUnusedFragmentsRuleTest.php
│ │ │ ├── NoUnusedVariablesRuleTest.php
│ │ │ ├── OverlappingFieldsCanBeMergedRuleTest.php
│ │ │ ├── PossibleFragmentSpreadsRuleTest.php
│ │ │ ├── ProvidedRequiredArgumentsRuleTest.php
│ │ │ ├── RuleTestCase.php
│ │ │ ├── ScalarLeafsRuleTest.php
│ │ │ ├── SingleFieldSubscriptionsRuleTest.php
│ │ │ ├── UniqueArgumentNamesRuleTest.php
│ │ │ ├── UniqueDirectivesPerLocationRuleTest.php
│ │ │ ├── UniqueFragmentNamesRuleTest.php
│ │ │ ├── UniqueInputFieldNamesRuleTest.php
│ │ │ ├── UniqueOperationNamesRuleTest.php
│ │ │ ├── UniqueVariableNamesRuleTest.php
│ │ │ ├── ValuesOfCorrectTypeRuleTest.php
│ │ │ ├── VariablesAreInputTypesRuleTest.php
│ │ │ ├── VariablesDefaultValueAllowedRuleTest.php
│ │ │ └── VariablesInAllowedPositionRuleTest.php
│ │ ├── ValidationTest.php
│ │ ├── errors.php
│ │ └── harness.php
│ ├── ValidationTest.php
│ ├── starWars.graphqls
│ ├── starWarsData.php
│ └── starWarsSchema.php
├── TestCase.php
├── Unit/
│ ├── Error/
│ │ ├── GraphQLExceptionTest.php
│ │ └── Handler/
│ │ └── ErrorHandlerTest.php
│ ├── Execution/
│ │ └── ExecutionResultTest.php
│ ├── Language/
│ │ ├── BlockStringValueTest.php
│ │ ├── LexerTest.php
│ │ └── NodeBuilderTest.php
│ ├── Schema/
│ │ └── Resolver/
│ │ └── ResolverRegistryTest.php
│ ├── Type/
│ │ └── Coercer/
│ │ ├── CoercerInterfaceTest.php
│ │ ├── FloatCoercerTest.php
│ │ ├── IntCoercerTest.php
│ │ └── StringCoercerTest.php
│ └── Util/
│ ├── AbstractEnumTest.php
│ ├── NameHelperTest.php
│ ├── NodeComparatorTest.php
│ ├── ValueASTConverterTest.php
│ ├── ValueConverterTest.php
│ └── ValueHelperTest.php
└── utils.php
Showing preview only (300K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2869 symbols across 391 files)
FILE: src/Error/AbstractException.php
class AbstractException (line 9) | abstract class AbstractException extends \Exception
FILE: src/Error/FileNotFoundException.php
class FileNotFoundException (line 9) | class FileNotFoundException extends AbstractException
FILE: src/Error/GraphQLException.php
class GraphQLException (line 17) | class GraphQLException extends AbstractException implements Serializatio...
method __construct (line 89) | public function __construct(
method getNodes (line 113) | public function getNodes(): ?array
method hasSource (line 121) | public function hasSource(): bool
method getSource (line 129) | public function getSource(): ?Source
method getPositions (line 137) | public function getPositions(): ?array
method hasLocations (line 145) | public function hasLocations(): bool
method getLocations (line 153) | public function getLocations(): ?array
method getLocationsAsArray (line 161) | public function getLocationsAsArray(): ?array
method getPath (line 171) | public function getPath(): ?array
method getExtensions (line 179) | public function getExtensions(): ?array
method setExtensions (line 188) | public function setExtensions(?array $extensions): self
method getOriginalException (line 197) | public function getOriginalException(): ?\Throwable
method getOriginalErrorMessage (line 205) | public function getOriginalErrorMessage(): ?string
method toArray (line 213) | public function toArray(): array
method __toString (line 235) | public function __toString(): string
method resolveNodes (line 244) | protected function resolveNodes(?array $nodes): self
method resolveSource (line 263) | protected function resolveSource(?Source $source): self
method resolvePositions (line 280) | protected function resolvePositions(?array $positions): self
method resolveLocations (line 308) | protected function resolveLocations(?array $positions, ?Source $source...
FILE: src/Error/Handler/AbstractErrorMiddleware.php
class AbstractErrorMiddleware (line 8) | abstract class AbstractErrorMiddleware implements ErrorMiddlewareInterface
method handleError (line 13) | public function handleError(\Throwable $exception, callable $next)
method handleExecutionError (line 20) | public function handleExecutionError(ExecutionException $exception, Ex...
FILE: src/Error/Handler/CallableMiddleware.php
class CallableMiddleware (line 8) | class CallableMiddleware extends AbstractErrorMiddleware
method __construct (line 19) | public function __construct(callable $handleCallback)
method handleExecutionError (line 27) | public function handleExecutionError(ExecutionException $exception, Ex...
FILE: src/Error/Handler/ErrorHandler.php
class ErrorHandler (line 8) | class ErrorHandler implements ErrorHandlerInterface
method __construct (line 19) | public function __construct(array $middleware)
method handleError (line 29) | public function handleError(\Throwable $exception): void
method handleExecutionError (line 47) | public function handleExecutionError(ExecutionException $exception, Ex...
method addMiddleware (line 65) | protected function addMiddleware(ErrorMiddlewareInterface $middleware)...
FILE: src/Error/Handler/ErrorHandlerInterface.php
type ErrorHandlerInterface (line 8) | interface ErrorHandlerInterface
method handleError (line 13) | public function handleError(\Throwable $exception): void;
method handleExecutionError (line 19) | public function handleExecutionError(ExecutionException $exception, Ex...
FILE: src/Error/Handler/ErrorMiddlewareInterface.php
type ErrorMiddlewareInterface (line 8) | interface ErrorMiddlewareInterface
method handleError (line 15) | public function handleError(\Throwable $exception, callable $next);
method handleExecutionError (line 23) | public function handleExecutionError(ExecutionException $exception, Ex...
FILE: src/Error/InvalidTypeException.php
class InvalidTypeException (line 5) | class InvalidTypeException extends GraphQLException
FILE: src/Error/InvariantException.php
class InvariantException (line 9) | class InvariantException extends AbstractException
FILE: src/Error/helpers.php
function formatError (line 15) | function formatError(?GraphQLException $error): array
function printError (line 34) | function printError(GraphQLException $error): string
function highlightSourceAtLocation (line 65) | function highlightSourceAtLocation(Source $source, SourceLocation $locat...
function getColumnOffset (line 98) | function getColumnOffset(Source $source, SourceLocation $location): int
function whitespace (line 107) | function whitespace(int $length): string
function leftPad (line 117) | function leftPad(int $length, string $str): string
FILE: src/Execution/CoercedValue.php
class CoercedValue (line 7) | class CoercedValue
method __construct (line 24) | public function __construct($value, array $errors = [])
method getErrors (line 33) | public function getErrors(): array
method hasErrors (line 41) | public function hasErrors(): bool
method setErrors (line 49) | public function setErrors(array $errors): void
method getValue (line 57) | public function getValue()
method setValue (line 65) | public function setValue($value): void
FILE: src/Execution/Execution.php
class Execution (line 17) | class Execution implements ExecutionInterface
method execute (line 22) | public function execute(
method executeOperation (line 76) | protected function executeOperation(
method createContext (line 118) | protected function createContext(
FILE: src/Execution/ExecutionContext.php
class ExecutionContext (line 9) | class ExecutionContext
method __construct (line 63) | public function __construct(
method getRootValue (line 86) | public function getRootValue()
method setRootValue (line 95) | public function setRootValue($rootValue): ExecutionContext
method getContextValue (line 104) | public function getContextValue()
method setContextValue (line 113) | public function setContextValue($contextValue): ExecutionContext
method getVariableValues (line 122) | public function getVariableValues()
method setVariableValues (line 131) | public function setVariableValues($variableValues): ExecutionContext
method hasFieldResolver (line 140) | public function hasFieldResolver(): bool
method getFieldResolver (line 148) | public function getFieldResolver(): ?callable
method setFieldResolver (line 157) | public function setFieldResolver(?callable $fieldResolver): ExecutionC...
method getOperation (line 167) | public function getOperation(): OperationDefinitionNode
method getSchema (line 175) | public function getSchema(): Schema
method getFragments (line 183) | public function getFragments(): array
method addError (line 192) | public function addError(ExecutionException $error): ExecutionContext
method getErrors (line 201) | public function getErrors(): array
FILE: src/Execution/ExecutionException.php
class ExecutionException (line 7) | class ExecutionException extends GraphQLException
FILE: src/Execution/ExecutionInterface.php
type ExecutionInterface (line 10) | interface ExecutionInterface
method execute (line 23) | public function execute(
FILE: src/Execution/ExecutionProvider.php
class ExecutionProvider (line 7) | class ExecutionProvider extends AbstractServiceProvider
method register (line 19) | public function register()
FILE: src/Execution/ExecutionResult.php
class ExecutionResult (line 9) | class ExecutionResult implements SerializationInterface
method __construct (line 28) | public function __construct(?array $data, array $errors)
method getData (line 37) | public function getData(): ?array
method getErrors (line 45) | public function getErrors(): array
method addError (line 54) | public function addError(GraphQLException $error): ExecutionResult
method toArray (line 63) | public function toArray(): array
FILE: src/Execution/InvalidReturnTypeException.php
class InvalidReturnTypeException (line 9) | class InvalidReturnTypeException extends GraphQLException
method __construct (line 19) | public function __construct(TypeInterface $returnType, $result, array ...
FILE: src/Execution/Path.php
class Path (line 5) | class Path
method __construct (line 22) | public function __construct(?Path $previous, $key)
method getPrevious (line 31) | public function getPrevious(): ?Path
method getKey (line 39) | public function getKey()
FILE: src/Execution/ResolveInfo.php
class ResolveInfo (line 11) | class ResolveInfo
method __construct (line 76) | public function __construct(
method getFieldName (line 104) | public function getFieldName(): string
method getFieldNodes (line 112) | public function getFieldNodes(): array
method getReturnType (line 120) | public function getReturnType(): TypeInterface
method getParentType (line 128) | public function getParentType(): ObjectType
method getPath (line 136) | public function getPath(): ?array
method getSchema (line 144) | public function getSchema(): Schema
method getFragments (line 152) | public function getFragments(): array
method getRootValue (line 160) | public function getRootValue()
method getOperation (line 168) | public function getOperation(): OperationDefinitionNode
method getVariableValues (line 176) | public function getVariableValues(): array
FILE: src/Execution/Strategy/AbstractExecutionStrategy.php
class AbstractExecutionStrategy (line 33) | abstract class AbstractExecutionStrategy implements ExecutionStrategyInt...
method executeFields (line 64) | abstract public function executeFields(ObjectType $parentType, $rootVa...
method __construct (line 74) | public function __construct(
method execute (line 94) | public function execute()
method getOperationType (line 141) | protected function getOperationType(Schema $schema, OperationDefinitio...
method resolveField (line 182) | protected function resolveField(ObjectType $parentType, $rootValue, ar...
method resolveFieldValueOrError (line 227) | protected function resolveFieldValueOrError(
method normalizeException (line 268) | protected function normalizeException($exception, array $nodes, array ...
method completeValueCatchingError (line 313) | public function completeValueCatchingError(
method completeValue (line 372) | protected function completeValue(
method completeListValue (line 448) | protected function completeListValue(
method completeLeafValue (line 489) | protected function completeLeafValue($returnType, &$result)
method completeAbstractValue (line 510) | protected function completeAbstractValue(
method completeObjectValue (line 568) | protected function completeObjectValue(
method executeSubFields (line 608) | protected function executeSubFields(ObjectType $returnType, array $fie...
method ensureValidRuntimeType (line 641) | protected function ensureValidRuntimeType(
method getFieldDefinition (line 701) | public function getFieldDefinition(Schema $schema, ObjectType $parentT...
method determineResolveCallback (line 726) | protected function determineResolveCallback(Field $field, ObjectType $...
method handleFieldError (line 750) | protected function handleFieldError(
method buildLocatedError (line 776) | protected function buildLocatedError(
method createResolveInfo (line 810) | protected function createResolveInfo(
method defaultTypeResolver (line 841) | public static function defaultTypeResolver(
method defaultFieldResolver (line 895) | public static function defaultFieldResolver($rootValue, array $argumen...
FILE: src/Execution/Strategy/ExecutionStrategyInterface.php
type ExecutionStrategyInterface (line 5) | interface ExecutionStrategyInterface
method execute (line 10) | public function execute();
FILE: src/Execution/Strategy/FieldCollector.php
class FieldCollector (line 22) | class FieldCollector
method __construct (line 43) | public function __construct(ExecutionContext $context)
method collectFields (line 61) | public function collectFields(
method shouldIncludeNode (line 123) | protected function shouldIncludeNode(NodeInterface $node): bool
method doesFragmentConditionMatch (line 149) | protected function doesFragmentConditionMatch($fragment, ObjectType $t...
FILE: src/Execution/Strategy/ParallelExecutionStrategy.php
class ParallelExecutionStrategy (line 17) | class ParallelExecutionStrategy extends AbstractExecutionStrategy
method executeFields (line 22) | public function executeFields(ObjectType $parentType, $rootValue, arra...
FILE: src/Execution/Strategy/SerialExecutionStrategy.php
class SerialExecutionStrategy (line 17) | class SerialExecutionStrategy extends AbstractExecutionStrategy
method executeFields (line 22) | public function executeFields(ObjectType $parentType, $rootValue, arra...
FILE: src/Execution/UndefinedFieldException.php
class UndefinedFieldException (line 7) | class UndefinedFieldException extends AbstractException
method __construct (line 12) | public function __construct(string $fieldName)
FILE: src/Execution/ValuesResolver.php
class ValuesResolver (line 36) | class ValuesResolver
method coerceArgumentValues (line 51) | public static function coerceArgumentValues(
method coerceDirectiveValues (line 181) | public static function coerceDirectiveValues(
method coerceVariableValues (line 211) | public static function coerceVariableValues(
method isInputType (line 303) | protected static function isInputType(?TypeInterface $type)
method coerceValue (line 323) | protected static function coerceValue($value, $type, $blameNode, ?Path...
method coerceValueForNonNullType (line 361) | protected static function coerceValueForNonNullType(
method coerceValueForScalarType (line 390) | protected static function coerceValueForScalarType(
method coerceValueForEnumType (line 425) | protected static function coerceValueForEnumType(
method coerceValueForInputObjectType (line 457) | protected static function coerceValueForInputObjectType(
method coerceValueForListType (line 529) | protected static function coerceValueForListType(
method buildCoerceException (line 568) | protected static function buildCoerceException(
method printPath (line 594) | protected static function printPath(?Path $path)
FILE: src/GraphQL.php
class GraphQL (line 39) | class GraphQL
method __construct (line 94) | private function __construct()
method getInstance (line 106) | public static function getInstance(): self
method make (line 119) | public static function make(string $id)
method buildSchema (line 132) | public static function buildSchema(Source $source, $resolverRegistry, ...
method extendSchema (line 153) | public static function extendSchema(
method validateSchema (line 176) | public static function validateSchema(Schema $schema): array
method parse (line 189) | public static function parse(Source $source, array $options = []): Doc...
method parseValue (line 202) | public static function parseValue(Source $source, array $options = [])...
method parseType (line 215) | public static function parseType(Source $source, array $options = []):...
method validate (line 228) | public static function validate(Schema $schema, DocumentNode $document...
method execute (line 247) | public static function execute(
method process (line 284) | public static function process(
method print (line 344) | public static function print(NodeInterface $node): string
method getContainer (line 355) | public function getContainer(): Container
method registerProviders (line 365) | protected function registerProviders(Container $container): void
FILE: src/Language/DirectiveLocationEnum.php
class DirectiveLocationEnum (line 5) | class DirectiveLocationEnum
method values (line 34) | public static function values(): array
FILE: src/Language/FileSourceBuilder.php
class FileSourceBuilder (line 12) | class FileSourceBuilder implements SourceBuilderInterface
method __construct (line 23) | public function __construct(string $filePath)
method build (line 34) | public function build(): Source
FILE: src/Language/KeywordEnum.php
class KeywordEnum (line 5) | class KeywordEnum
method values (line 22) | public const TRUE = 'true';
FILE: src/Language/LanguageException.php
class LanguageException (line 7) | class LanguageException extends AbstractException
FILE: src/Language/LanguageProvider.php
class LanguageProvider (line 7) | class LanguageProvider extends AbstractServiceProvider
method register (line 21) | public function register()
FILE: src/Language/Lexer.php
class Lexer (line 12) | class Lexer implements LexerInterface
method __construct (line 112) | public function __construct(Source $source, array $options)
method advance (line 130) | public function advance(): Token
method lookahead (line 140) | public function lookahead(): Token
method getOption (line 158) | public function getOption(string $name, $default = null)
method getSource (line 166) | public function getSource(): Source
method getToken (line 174) | public function getToken(): Token
method getLastToken (line 182) | public function getLastToken(): Token
method createSyntaxErrorException (line 190) | public function createSyntaxErrorException(?string $description = null...
method readToken (line 206) | protected function readToken(Token $prev): Token
method createStartOfFileToken (line 264) | protected function createStartOfFileToken(): Token
method createEndOfFileToken (line 277) | protected function createEndOfFileToken(int $line, int $column, Token ...
method lexPunctuation (line 292) | protected function lexPunctuation(int $code, int $line, int $column, T...
method lexName (line 309) | protected function lexName(int $line, int $column, Token $prev): Token
method lexNumber (line 336) | protected function lexNumber(int $code, int $line, int $column, Token ...
method skipDigits (line 400) | protected function skipDigits(int $code): void
method lexComment (line 423) | protected function lexComment(int $line, int $column, Token $prev): Token
method lexSpread (line 450) | protected function lexSpread(int $line, int $column, Token $prev): Token
method lexString (line 464) | protected function lexString(int $line, int $column, Token $prev): Token
method lexBlockString (line 560) | protected function lexBlockString(int $line, int $column, Token $prev)...
method skipWhitespace (line 605) | protected function skipWhitespace(): void
method readCharCode (line 638) | protected function readCharCode(int $position): int
method unexpectedCharacterMessage (line 665) | protected function unexpectedCharacterMessage(int $code): string
method isSpread (line 683) | protected function isSpread(int $code): bool
method isString (line 694) | protected function isString(int $code): bool
method isTripleQuote (line 703) | protected function isTripleQuote(int $code): bool
method isEscapedTripleQuote (line 714) | protected function isEscapedTripleQuote(int $code): bool
FILE: src/Language/LexerInterface.php
type LexerInterface (line 5) | interface LexerInterface
method advance (line 12) | public function advance(): Token;
method lookahead (line 20) | public function lookahead(): Token;
method getOption (line 29) | public function getOption(string $name, $default = null);
method getSource (line 36) | public function getSource(): Source;
method getToken (line 43) | public function getToken(): Token;
method getLastToken (line 50) | public function getLastToken(): Token;
method createSyntaxErrorException (line 58) | public function createSyntaxErrorException(?string $description = null...
FILE: src/Language/Location.php
class Location (line 8) | class Location implements SerializationInterface
method __construct (line 34) | public function __construct(int $start, int $end, ?Source $source = null)
method getStart (line 44) | public function getStart(): int
method getEnd (line 52) | public function getEnd(): int
method getSource (line 60) | public function getSource(): ?Source
method toArray (line 68) | public function toArray(): array
method __toString (line 79) | public function __toString(): string
FILE: src/Language/MultiFileSourceBuilder.php
class MultiFileSourceBuilder (line 12) | class MultiFileSourceBuilder implements SourceBuilderInterface
method __construct (line 24) | public function __construct(array $filePaths)
method build (line 35) | public function build(): Source
FILE: src/Language/Node/ASTNodeAwareInterface.php
type ASTNodeAwareInterface (line 5) | interface ASTNodeAwareInterface
method hasAstNode (line 10) | public function hasAstNode(): bool;
method getAstNode (line 15) | public function getAstNode(): ?NodeInterface;
FILE: src/Language/Node/ASTNodeTrait.php
type ASTNodeTrait (line 5) | trait ASTNodeTrait
method hasAstNode (line 15) | public function hasAstNode(): bool
method getAstNode (line 23) | public function getAstNode(): ?NodeInterface
method setAstNode (line 32) | protected function setAstNode(?NodeInterface $astNode)
FILE: src/Language/Node/AbstractNode.php
class AbstractNode (line 15) | abstract class AbstractNode implements NodeInterface, SerializationInter...
method toAST (line 47) | abstract public function toAST(): array;
method __construct (line 55) | public function __construct(string $kind, ?Location $location)
method getKind (line 64) | public function getKind(): string
method hasLocation (line 72) | public function hasLocation(): bool
method getLocation (line 80) | public function getLocation(): ?Location
method getLocationAST (line 88) | public function getLocationAST(): ?array
method toArray (line 98) | public function toArray(): array
method __toString (line 106) | public function __toString(): string
method acceptVisitor (line 114) | public function acceptVisitor(VisitorInfo $visitorInfo): ?NodeInterface
method getVisitorInfo (line 172) | public function getVisitorInfo(): ?VisitorInfo
method determineIsEdited (line 180) | public function determineIsEdited(NodeInterface $node): bool
method getAncestor (line 188) | public function getAncestor(int $depth = 1): ?NodeInterface
method isEdited (line 196) | public function isEdited(): bool
method visitNodeOrNodes (line 207) | protected function visitNodeOrNodes($nodeOrNodes, $key, NodeInterface ...
method visitNodes (line 225) | protected function visitNodes(array $nodes, $key): array
method visitNode (line 252) | protected function visitNode(NodeInterface $node, $key, ?NodeInterface...
method compareNode (line 280) | protected function compareNode(NodeInterface $other)
method getNodeBuilder (line 288) | protected function getNodeBuilder(): NodeBuilderInterface
FILE: src/Language/Node/AliasTrait.php
type AliasTrait (line 5) | trait AliasTrait
method getNameValue (line 16) | abstract public function getNameValue(): ?string;
method getAlias (line 21) | public function getAlias(): ?NameNode
method getAliasValue (line 29) | public function getAliasValue(): ?string
method getAliasOrNameValue (line 37) | public function getAliasOrNameValue(): ?string
method getAliasAST (line 45) | public function getAliasAST(): ?array
method setAlias (line 54) | public function setAlias(?NameNode $alias)
FILE: src/Language/Node/ArgumentNode.php
class ArgumentNode (line 7) | class ArgumentNode extends AbstractNode implements NameAwareInterface
method __construct (line 19) | public function __construct(NameNode $name, ValueNodeInterface $value,...
method toAST (line 30) | public function toAST(): array
FILE: src/Language/Node/ArgumentsAwareInterface.php
type ArgumentsAwareInterface (line 5) | interface ArgumentsAwareInterface
method hasArguments (line 10) | public function hasArguments(): bool;
method getArguments (line 15) | public function getArguments(): array;
method getArgumentsAST (line 20) | public function getArgumentsAST(): array;
method setArguments (line 26) | public function setArguments(array $arguments);
FILE: src/Language/Node/ArgumentsTrait.php
type ArgumentsTrait (line 5) | trait ArgumentsTrait
method hasArguments (line 15) | public function hasArguments(): bool
method getArguments (line 23) | public function getArguments(): array
method getArgumentsAST (line 31) | public function getArgumentsAST(): array
method setArguments (line 42) | public function setArguments(array $arguments)
FILE: src/Language/Node/BooleanValueNode.php
class BooleanValueNode (line 7) | class BooleanValueNode extends AbstractNode implements ValueNodeInterfac...
method __construct (line 17) | public function __construct($value, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/Node/DefaultValueTrait.php
type DefaultValueTrait (line 5) | trait DefaultValueTrait
method hasDefaultValue (line 15) | public function hasDefaultValue(): bool
method getDefaultValue (line 23) | public function getDefaultValue(): ?ValueNodeInterface
method getDefaultValueAST (line 31) | public function getDefaultValueAST(): ?array
FILE: src/Language/Node/DefinitionNodeInterface.php
type DefinitionNodeInterface (line 5) | interface DefinitionNodeInterface extends NodeInterface
FILE: src/Language/Node/DescriptionTrait.php
type DescriptionTrait (line 5) | trait DescriptionTrait
method getDescription (line 15) | public function getDescription(): ?StringValueNode
method getDescriptionValue (line 23) | public function getDescriptionValue(): ?string
method getDescriptionAST (line 31) | public function getDescriptionAST(): ?array
method setDescription (line 40) | public function setDescription(?StringValueNode $description)
FILE: src/Language/Node/DirectiveDefinitionNode.php
class DirectiveDefinitionNode (line 7) | class DirectiveDefinitionNode extends AbstractNode implements TypeSystem...
method __construct (line 27) | public function __construct(
method getLocations (line 45) | public function getLocations(): array
method getLocationsAST (line 53) | public function getLocationsAST(): array
method setLocations (line 64) | public function setLocations(array $locations)
method toAST (line 73) | public function toAST(): array
FILE: src/Language/Node/DirectiveNode.php
class DirectiveNode (line 7) | class DirectiveNode extends AbstractNode implements ArgumentsAwareInterf...
method __construct (line 19) | public function __construct(NameNode $name, array $arguments, ?Locatio...
method toAST (line 30) | public function toAST(): array
FILE: src/Language/Node/DirectivesAwareInterface.php
type DirectivesAwareInterface (line 5) | interface DirectivesAwareInterface
method hasDirectives (line 10) | public function hasDirectives(): bool;
method getDirectives (line 15) | public function getDirectives(): array;
method getDirectivesAST (line 20) | public function getDirectivesAST(): array;
method setDirectives (line 26) | public function setDirectives(array $directives);
FILE: src/Language/Node/DirectivesTrait.php
type DirectivesTrait (line 5) | trait DirectivesTrait
method hasDirectives (line 15) | public function hasDirectives(): bool
method getDirectives (line 23) | public function getDirectives(): array
method getDirectivesAST (line 31) | public function getDirectivesAST(): array
method setDirectives (line 42) | public function setDirectives(array $directives)
FILE: src/Language/Node/DocumentNode.php
class DocumentNode (line 7) | class DocumentNode extends AbstractNode
method __construct (line 20) | public function __construct(array $definitions, ?Location $location)
method getDefinitions (line 30) | public function getDefinitions(): array
method getDefinitionsAST (line 38) | public function getDefinitionsAST(): array
method toAST (line 48) | public function toAST(): array
method setDefinitions (line 61) | protected function setDefinitions(array $definitions): DocumentNode
FILE: src/Language/Node/EnumTypeDefinitionNode.php
class EnumTypeDefinitionNode (line 7) | class EnumTypeDefinitionNode extends AbstractNode implements
method __construct (line 27) | public function __construct(
method toAST (line 45) | public function toAST(): array
FILE: src/Language/Node/EnumTypeExtensionNode.php
class EnumTypeExtensionNode (line 7) | class EnumTypeExtensionNode extends AbstractNode implements
method __construct (line 24) | public function __construct(NameNode $name, array $directives, array $...
method toAST (line 36) | public function toAST(): array
FILE: src/Language/Node/EnumValueDefinitionNode.php
class EnumValueDefinitionNode (line 7) | class EnumValueDefinitionNode extends AbstractNode implements
method __construct (line 24) | public function __construct(
method toAST (line 40) | public function toAST(): array
FILE: src/Language/Node/EnumValueNode.php
class EnumValueNode (line 7) | class EnumValueNode extends AbstractNode implements ValueNodeInterface
method __construct (line 17) | public function __construct($value, ?Location $location)
method __toString (line 27) | public function __toString(): string
method toAST (line 35) | public function toAST(): array
FILE: src/Language/Node/EnumValuesTrait.php
type EnumValuesTrait (line 5) | trait EnumValuesTrait
method hasValues (line 15) | public function hasValues(): bool
method getValues (line 23) | public function getValues(): array
method getValuesAST (line 31) | public function getValuesAST(): array
method setValues (line 42) | public function setValues(array $values)
FILE: src/Language/Node/ExecutableDefinitionNodeInterface.php
type ExecutableDefinitionNodeInterface (line 5) | interface ExecutableDefinitionNodeInterface extends DefinitionNodeInterface
method getNameValue (line 12) | public function getNameValue(): ?string;
FILE: src/Language/Node/FieldDefinitionNode.php
class FieldDefinitionNode (line 7) | class FieldDefinitionNode extends AbstractNode implements
method __construct (line 28) | public function __construct(
method toAST (line 48) | public function toAST(): array
FILE: src/Language/Node/FieldNode.php
class FieldNode (line 7) | class FieldNode extends AbstractNode implements
method __construct (line 30) | public function __construct(
method toAST (line 50) | public function toAST(): array
FILE: src/Language/Node/FieldsTrait.php
type FieldsTrait (line 5) | trait FieldsTrait
method hasFields (line 15) | public function hasFields(): bool
method getFields (line 23) | public function getFields(): array
method getFieldsAST (line 31) | public function getFieldsAST(): array
method setFields (line 42) | public function setFields(array $fields)
FILE: src/Language/Node/FloatValueNode.php
class FloatValueNode (line 7) | class FloatValueNode extends AbstractNode implements ValueNodeInterface,...
method __construct (line 17) | public function __construct($value, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/Node/FragmentDefinitionNode.php
class FragmentDefinitionNode (line 7) | class FragmentDefinitionNode extends AbstractNode implements
method __construct (line 30) | public function __construct(
method toAST (line 50) | public function toAST(): array
FILE: src/Language/Node/FragmentNodeInterface.php
type FragmentNodeInterface (line 5) | interface FragmentNodeInterface extends NodeInterface
FILE: src/Language/Node/FragmentSpreadNode.php
class FragmentSpreadNode (line 7) | class FragmentSpreadNode extends AbstractNode implements
method __construct (line 25) | public function __construct(
method toAST (line 41) | public function toAST(): array
FILE: src/Language/Node/InlineFragmentNode.php
class InlineFragmentNode (line 7) | class InlineFragmentNode extends AbstractNode implements
method __construct (line 24) | public function __construct(
method toAST (line 40) | public function toAST(): array
FILE: src/Language/Node/InputArgumentsTrait.php
type InputArgumentsTrait (line 5) | trait InputArgumentsTrait
method hasArguments (line 15) | public function hasArguments(): bool
method getArguments (line 23) | public function getArguments(): array
method getArgumentsAST (line 31) | public function getArgumentsAST(): array
method setArguments (line 42) | public function setArguments(array $arguments)
FILE: src/Language/Node/InputFieldsTrait.php
type InputFieldsTrait (line 5) | trait InputFieldsTrait
method hasFields (line 15) | public function hasFields(): bool
method getFields (line 23) | public function getFields(): array
method getFieldsAST (line 31) | public function getFieldsAST(): array
method setFields (line 42) | public function setFields(array $fields)
FILE: src/Language/Node/InputObjectTypeDefinitionNode.php
class InputObjectTypeDefinitionNode (line 7) | class InputObjectTypeDefinitionNode extends AbstractNode implements
method __construct (line 27) | public function __construct(
method toAST (line 45) | public function toAST(): array
FILE: src/Language/Node/InputObjectTypeExtensionNode.php
class InputObjectTypeExtensionNode (line 7) | class InputObjectTypeExtensionNode extends AbstractNode implements
method __construct (line 24) | public function __construct(
method toAST (line 40) | public function toAST(): array
FILE: src/Language/Node/InputValueDefinitionNode.php
class InputValueDefinitionNode (line 7) | class InputValueDefinitionNode extends AbstractNode implements
method __construct (line 28) | public function __construct(
method toAST (line 48) | public function toAST(): array
FILE: src/Language/Node/IntValueNode.php
class IntValueNode (line 7) | class IntValueNode extends AbstractNode implements ValueNodeInterface, V...
method __construct (line 17) | public function __construct($value, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/Node/InterfaceTypeDefinitionNode.php
class InterfaceTypeDefinitionNode (line 7) | class InterfaceTypeDefinitionNode extends AbstractNode implements
method __construct (line 27) | public function __construct(
method toAST (line 45) | public function toAST(): array
FILE: src/Language/Node/InterfaceTypeExtensionNode.php
class InterfaceTypeExtensionNode (line 7) | class InterfaceTypeExtensionNode extends AbstractNode implements
method __construct (line 24) | public function __construct(NameNode $name, array $directives, array $...
method toAST (line 36) | public function toAST(): array
FILE: src/Language/Node/InterfacesTrait.php
type InterfacesTrait (line 5) | trait InterfacesTrait
method hasInterfaces (line 15) | public function hasInterfaces(): bool
method getInterfaces (line 23) | public function getInterfaces(): array
method getInterfacesAST (line 31) | public function getInterfacesAST(): array
method setInterfaces (line 42) | public function setInterfaces(array $interfaces)
FILE: src/Language/Node/ListTypeNode.php
class ListTypeNode (line 7) | class ListTypeNode extends AbstractNode implements TypeNodeInterface
method __construct (line 17) | public function __construct(TypeNodeInterface $type, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/Node/ListValueNode.php
class ListValueNode (line 7) | class ListValueNode extends AbstractNode implements ValueNodeInterface
method __construct (line 20) | public function __construct(array $values, ?Location $location)
method getValues (line 30) | public function getValues(): array
method getValuesAST (line 38) | public function getValuesAST(): array
method setValues (line 49) | public function setValues(array $values)
method toAST (line 58) | public function toAST(): array
method __toString (line 70) | public function __toString(): string
FILE: src/Language/Node/NameAwareInterface.php
type NameAwareInterface (line 5) | interface NameAwareInterface
method getName (line 10) | public function getName(): ?NameNode;
method getNameValue (line 15) | public function getNameValue(): ?string;
method getNameAST (line 20) | public function getNameAST(): ?array;
method setName (line 26) | public function setName(?NameNode $name);
method __toString (line 31) | public function __toString(): string;
FILE: src/Language/Node/NameNode.php
class NameNode (line 7) | class NameNode extends AbstractNode
method __construct (line 22) | public function __construct($value, ?Location $location)
method toAST (line 32) | public function toAST(): array
FILE: src/Language/Node/NameTrait.php
type NameTrait (line 5) | trait NameTrait
method getName (line 15) | public function getName(): ?NameNode
method getNameValue (line 23) | public function getNameValue(): ?string
method getNameAST (line 31) | public function getNameAST(): ?array
method setName (line 40) | public function setName(?NameNode $name)
method __toString (line 49) | public function __toString(): string
FILE: src/Language/Node/NamedTypeNode.php
class NamedTypeNode (line 7) | class NamedTypeNode extends AbstractNode implements NamedTypeNodeInterfa...
method __construct (line 17) | public function __construct(NameNode $name, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/Node/NamedTypeNodeInterface.php
type NamedTypeNodeInterface (line 8) | interface NamedTypeNodeInterface extends TypeNodeInterface
method getName (line 13) | public function getName(): ?NameNode;
method getNameValue (line 18) | public function getNameValue(): ?string;
FILE: src/Language/Node/NodeInterface.php
type NodeInterface (line 10) | interface NodeInterface
method getKind (line 16) | public function getKind(): string;
method hasLocation (line 21) | public function hasLocation(): bool;
method getLocation (line 26) | public function getLocation(): ?Location;
method toAST (line 31) | public function toAST(): array;
method toJSON (line 36) | public function toJSON(): string;
method acceptVisitor (line 42) | public function acceptVisitor(VisitorInfo $visitorInfo): ?NodeInterface;
method getVisitorInfo (line 47) | public function getVisitorInfo(): ?VisitorInfo;
method determineIsEdited (line 53) | public function determineIsEdited(NodeInterface $node): bool;
method getAncestor (line 59) | public function getAncestor(int $depth = 1): ?NodeInterface;
method isEdited (line 64) | public function isEdited(): bool;
FILE: src/Language/Node/NodeKindEnum.php
class NodeKindEnum (line 5) | class NodeKindEnum
method values (line 77) | public static function values(): array
FILE: src/Language/Node/NonNullTypeNode.php
class NonNullTypeNode (line 7) | class NonNullTypeNode extends AbstractNode implements TypeNodeInterface
method __construct (line 17) | public function __construct(TypeNodeInterface $type, ?Location $location)
method toAST (line 27) | public function toAST(): array
method __toString (line 39) | public function __toString(): string
FILE: src/Language/Node/NullValueNode.php
class NullValueNode (line 7) | class NullValueNode extends AbstractNode implements ValueNodeInterface
method __construct (line 14) | public function __construct(?Location $location)
method toAST (line 22) | public function toAST(): array
FILE: src/Language/Node/ObjectFieldNode.php
class ObjectFieldNode (line 7) | class ObjectFieldNode extends AbstractNode implements NameAwareInterface
method __construct (line 19) | public function __construct(NameNode $name, ?ValueNodeInterface $value...
method toAST (line 30) | public function toAST(): array
FILE: src/Language/Node/ObjectTypeDefinitionNode.php
class ObjectTypeDefinitionNode (line 7) | class ObjectTypeDefinitionNode extends AbstractNode implements
method __construct (line 29) | public function __construct(
method toAST (line 49) | public function toAST(): array
FILE: src/Language/Node/ObjectTypeExtensionNode.php
class ObjectTypeExtensionNode (line 7) | class ObjectTypeExtensionNode extends AbstractNode implements
method __construct (line 26) | public function __construct(
method toAST (line 44) | public function toAST(): array
FILE: src/Language/Node/ObjectValueNode.php
class ObjectValueNode (line 7) | class ObjectValueNode extends AbstractNode implements ValueNodeInterface
method __construct (line 20) | public function __construct(array $fields, ?Location $location)
method getFields (line 30) | public function getFields(): array
method getFieldsAST (line 38) | public function getFieldsAST(): array
method setFields (line 49) | public function setFields(array $fields)
method toAST (line 58) | public function toAST(): array
FILE: src/Language/Node/OperationDefinitionNode.php
class OperationDefinitionNode (line 7) | class OperationDefinitionNode extends AbstractNode implements
method __construct (line 34) | public function __construct(
method getOperation (line 54) | public function getOperation(): string
method toAST (line 62) | public function toAST(): array
FILE: src/Language/Node/OperationTypeDefinitionNode.php
class OperationTypeDefinitionNode (line 7) | class OperationTypeDefinitionNode extends AbstractNode implements Defini...
method __construct (line 23) | public function __construct(string $operation, TypeNodeInterface $type...
method getOperation (line 34) | public function getOperation(): string
method toAST (line 42) | public function toAST(): array
FILE: src/Language/Node/ScalarTypeDefinitionNode.php
class ScalarTypeDefinitionNode (line 7) | class ScalarTypeDefinitionNode extends AbstractNode implements
method __construct (line 25) | public function __construct(?StringValueNode $description, NameNode $n...
method toAST (line 37) | public function toAST(): array
FILE: src/Language/Node/ScalarTypeExtensionNode.php
class ScalarTypeExtensionNode (line 7) | class ScalarTypeExtensionNode extends AbstractNode implements
method __construct (line 22) | public function __construct(NameNode $name, array $directives, ?Locati...
method toAST (line 33) | public function toAST(): array
FILE: src/Language/Node/SchemaDefinitionNode.php
class SchemaDefinitionNode (line 7) | class SchemaDefinitionNode extends AbstractNode implements TypeSystemDef...
method __construct (line 23) | public function __construct(array $directives, array $operationTypes, ...
method getOperationTypes (line 34) | public function getOperationTypes(): array
method getOperationTypesAST (line 42) | public function getOperationTypesAST(): array
method setOperationTypes (line 53) | public function setOperationTypes(array $operationTypes)
method toAST (line 62) | public function toAST(): array
FILE: src/Language/Node/SchemaExtensionNode.php
class SchemaExtensionNode (line 7) | class SchemaExtensionNode extends AbstractNode implements TypeSystemExte...
method __construct (line 22) | public function __construct(array $directives, array $operationTypes, ...
method getOperationTypes (line 33) | public function getOperationTypes(): array
method getOperationTypesAST (line 41) | public function getOperationTypesAST(): array
method setOperationTypes (line 52) | public function setOperationTypes(array $operationTypes)
method toAST (line 61) | public function toAST(): array
FILE: src/Language/Node/SelectionNodeInterface.php
type SelectionNodeInterface (line 5) | interface SelectionNodeInterface extends NodeInterface
FILE: src/Language/Node/SelectionSetAwareInterface.php
type SelectionSetAwareInterface (line 5) | interface SelectionSetAwareInterface
method hasSelectionSet (line 10) | public function hasSelectionSet(): bool;
method getSelectionSet (line 15) | public function getSelectionSet(): ?SelectionSetNode;
FILE: src/Language/Node/SelectionSetNode.php
class SelectionSetNode (line 7) | class SelectionSetNode extends AbstractNode
method __construct (line 20) | public function __construct(array $selections, ?Location $location)
method getSelections (line 30) | public function getSelections(): array
method getSelectionsAST (line 38) | public function getSelectionsAST(): array
method setSelections (line 49) | public function setSelections(array $selections): SelectionSetNode
method toAST (line 58) | public function toAST(): array
FILE: src/Language/Node/SelectionSetTrait.php
type SelectionSetTrait (line 5) | trait SelectionSetTrait
method hasSelectionSet (line 16) | public function hasSelectionSet(): bool
method getSelectionSet (line 24) | public function getSelectionSet(): ?SelectionSetNode
method getSelectionSetAST (line 32) | public function getSelectionSetAST(): ?array
method setSelectionSet (line 41) | public function setSelectionSet(?SelectionSetNode $selectionSet)
FILE: src/Language/Node/StringValueNode.php
class StringValueNode (line 7) | class StringValueNode extends AbstractNode implements ValueNodeInterface...
method __construct (line 23) | public function __construct($value, bool $block, ?Location $location)
method isBlock (line 34) | public function isBlock(): bool
method toAST (line 42) | public function toAST(): array
FILE: src/Language/Node/TypeConditionTrait.php
type TypeConditionTrait (line 5) | trait TypeConditionTrait
method getTypeCondition (line 15) | public function getTypeCondition(): ?NamedTypeNode
method getTypeConditionAST (line 23) | public function getTypeConditionAST(): ?array
method setTypeCondition (line 32) | public function setTypeCondition(?NamedTypeNode $typeCondition)
FILE: src/Language/Node/TypeNodeInterface.php
type TypeNodeInterface (line 8) | interface TypeNodeInterface extends NodeInterface
FILE: src/Language/Node/TypeSystemDefinitionNodeInterface.php
type TypeSystemDefinitionNodeInterface (line 8) | interface TypeSystemDefinitionNodeInterface extends DefinitionNodeInterface
FILE: src/Language/Node/TypeSystemExtensionNodeInterface.php
type TypeSystemExtensionNodeInterface (line 5) | interface TypeSystemExtensionNodeInterface extends NodeInterface
FILE: src/Language/Node/TypeTrait.php
type TypeTrait (line 5) | trait TypeTrait
method getType (line 15) | public function getType()
method getTypeAST (line 23) | public function getTypeAST(): array
method setType (line 32) | public function setType($type)
FILE: src/Language/Node/TypesTrait.php
type TypesTrait (line 5) | trait TypesTrait
method hasTypes (line 15) | public function hasTypes(): bool
method getTypes (line 23) | public function getTypes(): array
method getTypesAST (line 31) | public function getTypesAST(): array
method setTypes (line 42) | public function setTypes(array $types)
FILE: src/Language/Node/UnionTypeDefinitionNode.php
class UnionTypeDefinitionNode (line 7) | class UnionTypeDefinitionNode extends AbstractNode implements
method __construct (line 26) | public function __construct(
method toAST (line 44) | public function toAST(): array
FILE: src/Language/Node/UnionTypeExtensionNode.php
class UnionTypeExtensionNode (line 7) | class UnionTypeExtensionNode extends AbstractNode implements
method __construct (line 24) | public function __construct(NameNode $name, array $directives, array $...
method toAST (line 36) | public function toAST(): array
FILE: src/Language/Node/ValueAwareInterface.php
type ValueAwareInterface (line 5) | interface ValueAwareInterface
method getValue (line 10) | public function getValue();
FILE: src/Language/Node/ValueLiteralTrait.php
type ValueLiteralTrait (line 5) | trait ValueLiteralTrait
method getValue (line 15) | public function getValue()
method getValueAST (line 23) | public function getValueAST(): ?array
method setValue (line 32) | public function setValue($value)
FILE: src/Language/Node/ValueNodeInterface.php
type ValueNodeInterface (line 5) | interface ValueNodeInterface extends NodeInterface
FILE: src/Language/Node/ValueTrait.php
type ValueTrait (line 5) | trait ValueTrait
method getValue (line 15) | public function getValue()
method setValue (line 24) | public function setValue($value)
FILE: src/Language/Node/VariableDefinitionNode.php
class VariableDefinitionNode (line 7) | class VariableDefinitionNode extends AbstractNode implements DefinitionN...
method __construct (line 25) | public function __construct(
method getVariable (line 41) | public function getVariable(): VariableNode
method getVariableAST (line 49) | public function getVariableAST(): array
method __toString (line 57) | public function __toString(): string
method toAST (line 65) | public function toAST(): array
FILE: src/Language/Node/VariableDefinitionsAwareInterface.php
type VariableDefinitionsAwareInterface (line 5) | interface VariableDefinitionsAwareInterface
method getVariableDefinitions (line 10) | public function getVariableDefinitions(): array;
FILE: src/Language/Node/VariableDefinitionsTrait.php
type VariableDefinitionsTrait (line 5) | trait VariableDefinitionsTrait
method getVariableDefinitions (line 15) | public function getVariableDefinitions(): array
method getVariableDefinitionsAST (line 23) | public function getVariableDefinitionsAST(): array
method setVariableDefinitions (line 34) | protected function setVariableDefinitions(array $variableDefinitions)
FILE: src/Language/Node/VariableNode.php
class VariableNode (line 7) | class VariableNode extends AbstractNode implements ValueNodeInterface, N...
method __construct (line 17) | public function __construct(NameNode $name, ?Location $location)
method toAST (line 27) | public function toAST(): array
FILE: src/Language/NodeBuilder.php
class NodeBuilder (line 51) | class NodeBuilder implements NodeBuilderInterface
method build (line 58) | public function build(array $ast): NodeInterface
method buildArgument (line 165) | protected function buildArgument(array $ast): ArgumentNode
method buildBoolean (line 178) | protected function buildBoolean(array $ast): BooleanValueNode
method buildDirectiveDefinition (line 191) | protected function buildDirectiveDefinition(array $ast): DirectiveDefi...
method buildDirective (line 207) | protected function buildDirective(array $ast): DirectiveNode
method buildDocument (line 221) | protected function buildDocument(array $ast): DocumentNode
method buildEnum (line 233) | protected function buildEnum(array $ast): EnumValueNode
method buildEnumTypeDefinition (line 246) | protected function buildEnumTypeDefinition(array $ast): EnumTypeDefini...
method buildEnumTypeExtension (line 262) | protected function buildEnumTypeExtension(array $ast): EnumTypeExtensi...
method buildEnumValueDefinition (line 277) | protected function buildEnumValueDefinition(array $ast): EnumValueDefi...
method buildFieldDefinition (line 292) | protected function buildFieldDefinition(array $ast): FieldDefinitionNode
method buildField (line 309) | protected function buildField(array $ast): FieldNode
method buildFloat (line 325) | protected function buildFloat(array $ast): FloatValueNode
method buildFragmentDefinition (line 338) | protected function buildFragmentDefinition(array $ast): FragmentDefini...
method buildFragmentSpread (line 355) | protected function buildFragmentSpread(array $ast): FragmentSpreadNode
method buildInlineFragment (line 370) | protected function buildInlineFragment(array $ast): InlineFragmentNode
method buildInputObjectTypeDefinition (line 385) | protected function buildInputObjectTypeDefinition(array $ast): InputOb...
method buildInputObjectTypeExtension (line 401) | protected function buildInputObjectTypeExtension(array $ast): InputObj...
method buildInputValueDefinition (line 416) | protected function buildInputValueDefinition(array $ast): InputValueDe...
method buildInterfaceTypeDefinition (line 433) | protected function buildInterfaceTypeDefinition(array $ast): Interface...
method buildInterfaceTypeExtension (line 449) | protected function buildInterfaceTypeExtension(array $ast): InterfaceT...
method buildInt (line 463) | protected function buildInt(array $ast): IntValueNode
method buildListType (line 476) | protected function buildListType(array $ast): ListTypeNode
method buildList (line 489) | protected function buildList(array $ast): ListValueNode
method buildNamedType (line 502) | protected function buildNamedType(array $ast): NamedTypeNode
method buildName (line 514) | protected function buildName(array $ast): NameNode
method buildNonNullType (line 527) | protected function buildNonNullType(array $ast): NonNullTypeNode
method buildNull (line 539) | protected function buildNull(array $ast): NullValueNode
method buildObjectField (line 549) | protected function buildObjectField(array $ast): ObjectFieldNode
method buildObjectTypeDefinition (line 563) | protected function buildObjectTypeDefinition(array $ast): ObjectTypeDe...
method buildObjectTypeExtension (line 580) | protected function buildObjectTypeExtension(array $ast): ObjectTypeExt...
method buildObject (line 596) | protected function buildObject(array $ast): ObjectValueNode
method buildOperationDefinition (line 609) | protected function buildOperationDefinition(array $ast): OperationDefi...
method buildOperationTypeDefinition (line 626) | protected function buildOperationTypeDefinition(array $ast): Operation...
method buildScalarTypeDefinition (line 640) | protected function buildScalarTypeDefinition(array $ast): ScalarTypeDe...
method buildScalarTypeExtension (line 655) | protected function buildScalarTypeExtension(array $ast): ScalarTypeExt...
method buildSchemaDefinition (line 669) | protected function buildSchemaDefinition(array $ast): SchemaDefinition...
method buildSchemaExtension (line 683) | protected function buildSchemaExtension(array $ast): SchemaExtensionNode
method buildSelectionSet (line 697) | protected function buildSelectionSet(array $ast): SelectionSetNode
method buildString (line 709) | protected function buildString(array $ast): StringValueNode
method buildUnionTypeDefinition (line 723) | protected function buildUnionTypeDefinition(array $ast): UnionTypeDefi...
method buildUnionTypeExtension (line 739) | protected function buildUnionTypeExtension(array $ast): UnionTypeExten...
method buildVariableDefinition (line 754) | protected function buildVariableDefinition(array $ast): VariableDefini...
method buildVariable (line 769) | protected function buildVariable(array $ast): VariableNode
method createLocation (line 783) | protected function createLocation(array $ast): ?Location
method getValue (line 798) | protected function getValue(array $ast, string $propertyName, $default...
method buildNode (line 811) | protected function buildNode(array $ast, string $propertyName): ?NodeI...
method buildNodes (line 824) | protected function buildNodes(array $ast, string $propertyName): array
FILE: src/Language/NodeBuilderInterface.php
type NodeBuilderInterface (line 9) | interface NodeBuilderInterface
method build (line 15) | public function build(array $ast): NodeInterface;
FILE: src/Language/NodePrinter.php
class NodePrinter (line 32) | class NodePrinter implements NodePrinterInterface
method print (line 38) | public function print(NodeInterface $node): string
method printName (line 53) | protected function printName(NameNode $node): ?string
method printVariable (line 62) | protected function printVariable(VariableNode $node): string
method printDocument (line 73) | protected function printDocument(DocumentNode $node): string
method printOperationDefinition (line 83) | protected function printOperationDefinition(OperationDefinitionNode $n...
method printVariableDefinition (line 108) | protected function printVariableDefinition(VariableDefinitionNode $nod...
method printSelectionSet (line 121) | protected function printSelectionSet(SelectionSetNode $node): string
method printField (line 131) | protected function printField(FieldNode $node): string
method printArgument (line 151) | protected function printArgument(ArgumentNode $node): string
method printFragmentSpread (line 166) | protected function printFragmentSpread(FragmentSpreadNode $node): string
method printInlineFragment (line 179) | protected function printInlineFragment(InlineFragmentNode $node): string
method printFragmentDefinition (line 197) | protected function printFragmentDefinition(FragmentDefinitionNode $nod...
method printIntValue (line 220) | protected function printIntValue(IntValueNode $node): string
method printFloatValue (line 229) | protected function printFloatValue(FloatValueNode $node): string
method printStringValue (line 238) | protected function printStringValue(StringValueNode $node): string
method printBooleanValue (line 251) | protected function printBooleanValue(BooleanValueNode $node): string
method printNullValue (line 260) | protected function printNullValue(NullValueNode $node): string
method printEnumValue (line 269) | protected function printEnumValue(EnumValueNode $node): string
method printListValue (line 278) | protected function printListValue(ListValueNode $node): string
method printObjectValue (line 288) | protected function printObjectValue(ObjectValueNode $node): string
method printObjectField (line 299) | protected function printObjectField(ObjectFieldNode $node): string
method printDirective (line 314) | protected function printDirective(DirectiveNode $node): string
method printNamedType (line 329) | protected function printNamedType(NamedTypeNode $node): string
method printListType (line 339) | protected function printListType(ListTypeNode $node): string
method printNonNullType (line 349) | protected function printNonNullType(NonNullTypeNode $node): string
method printOne (line 359) | protected function printOne(?NodeInterface $node): string
method printMany (line 368) | protected function printMany(array $nodes): array
FILE: src/Language/NodePrinterInterface.php
type NodePrinterInterface (line 9) | interface NodePrinterInterface
method print (line 15) | public function print(NodeInterface $node): string;
FILE: src/Language/Parser.php
class Parser (line 64) | class Parser implements ParserInterface
method __call (line 79) | public function __call(string $name, array $arguments)
method parse (line 99) | public function parse(Source $source, array $options = []): DocumentNode
method parsePartial (line 113) | protected function parsePartial(callable $lexCallback, Source $source,...
method lexName (line 130) | protected function lexName(): NameNode
method lexDocument (line 146) | protected function lexDocument(): DocumentNode
method lexDefinition (line 170) | protected function lexDefinition(): NodeInterface
method lexExecutableDefinition (line 211) | protected function lexExecutableDefinition(): ExecutableDefinitionNode...
method lexOperationDefinition (line 243) | protected function lexOperationDefinition(): OperationDefinitionNode
method lexOperationType (line 281) | protected function lexOperationType(): ?string
method lexVariableDefinitions (line 299) | protected function lexVariableDefinitions(): array
method lexVariableDefinition (line 316) | protected function lexVariableDefinition(): VariableDefinitionNode
method lexVariable (line 344) | protected function lexVariable(): VariableNode
method lexSelectionSet (line 359) | protected function lexSelectionSet(): SelectionSetNode
method lexSelection (line 382) | protected function lexSelection(): NodeInterface
method lexField (line 397) | protected function lexField(): FieldNode
method lexArguments (line 429) | protected function lexArguments(bool $isConst = false): ?array
method lexArgument (line 454) | protected function lexArgument(bool $isConst = false): ArgumentNode
method lexFragment (line 485) | protected function lexFragment(): FragmentNodeInterface
method lexFragmentDefinition (line 524) | protected function lexFragmentDefinition(): FragmentDefinitionNode
method lexFragmentName (line 552) | protected function lexFragmentName(?Token $token = null): NameNode
method lexValue (line 589) | protected function lexValue(bool $isConst = false): NodeInterface
method lexStringLiteral (line 634) | protected function lexStringLiteral(): StringValueNode
method lexList (line 656) | protected function lexList(bool $isConst): ListValueNode
method lexObject (line 683) | protected function lexObject(bool $isConst): ObjectValueNode
method lexObjectField (line 705) | protected function lexObjectField(bool $isConst): ObjectFieldNode
method lexDirectives (line 734) | protected function lexDirectives(bool $isConst = false): array
method lexDirective (line 752) | protected function lexDirective(bool $isConst = false): DirectiveNode
method lexType (line 776) | protected function lexType(): TypeNodeInterface
method lexNamedType (line 803) | protected function lexNamedType(): NamedTypeNode
method lexTypeSystemDefinition (line 831) | protected function lexTypeSystemDefinition(): TypeSystemDefinitionNode...
method peekDescription (line 865) | protected function peekDescription(): bool
method lexDescription (line 875) | public function lexDescription(): ?StringValueNode
method lexSchemaDefinition (line 888) | protected function lexSchemaDefinition(): SchemaDefinitionNode
method lexOperationTypeDefinition (line 911) | protected function lexOperationTypeDefinition(): OperationTypeDefiniti...
method lexScalarTypeDefinition (line 932) | protected function lexScalarTypeDefinition(): ScalarTypeDefinitionNode
method lexObjectTypeDefinition (line 956) | protected function lexObjectTypeDefinition(): ObjectTypeDefinitionNode
method lexImplementsInterfaces (line 982) | protected function lexImplementsInterfaces(): array
method lexFieldsDefinition (line 1008) | protected function lexFieldsDefinition(): array
method lexFieldDefinition (line 1026) | protected function lexFieldDefinition(): FieldDefinitionNode
method lexArgumentsDefinition (line 1052) | protected function lexArgumentsDefinition(): array
method lexInputValueDefinition (line 1074) | protected function lexInputValueDefinition(): InputValueDefinitionNode
method lexInterfaceTypeDefinition (line 1102) | protected function lexInterfaceTypeDefinition(): InterfaceTypeDefiniti...
method lexUnionTypeDefinition (line 1126) | protected function lexUnionTypeDefinition(): UnionTypeDefinitionNode
method lexUnionMemberTypes (line 1151) | protected function lexUnionMemberTypes(): array
method lexEnumTypeDefinition (line 1174) | protected function lexEnumTypeDefinition(): EnumTypeDefinitionNode
method lexEnumValuesDefinition (line 1197) | protected function lexEnumValuesDefinition(): array
method lexEnumValueDefinition (line 1216) | protected function lexEnumValueDefinition(): EnumValueDefinitionNode
method lexInputObjectTypeDefinition (line 1235) | protected function lexInputObjectTypeDefinition(): InputObjectTypeDefi...
method lexInputFieldsDefinition (line 1258) | protected function lexInputFieldsDefinition(): array
method lexTypeSystemExtension (line 1285) | protected function lexTypeSystemExtension(): TypeSystemExtensionNodeIn...
method lexSchemaExtension (line 1319) | protected function lexSchemaExtension(): SchemaExtensionNode
method lexScalarTypeExtension (line 1355) | protected function lexScalarTypeExtension(bool $isConst = false): Scal...
method lexObjectTypeExtension (line 1381) | protected function lexObjectTypeExtension(): ObjectTypeExtensionNode
method lexInterfaceTypeExtension (line 1414) | protected function lexInterfaceTypeExtension(): InterfaceTypeExtension...
method lexUnionTypeExtension (line 1440) | protected function lexUnionTypeExtension(): UnionTypeExtensionNode
method lexEnumTypeExtension (line 1466) | protected function lexEnumTypeExtension(): EnumTypeExtensionNode
method lexInputObjectTypeExtension (line 1492) | protected function lexInputObjectTypeExtension(): InputObjectTypeExten...
method lexDirectiveDefinition (line 1518) | protected function lexDirectiveDefinition(): DirectiveDefinitionNode
method lexDirectiveLocations (line 1552) | protected function lexDirectiveLocations(): array
method lexDirectiveLocation (line 1596) | protected function lexDirectiveLocation(): NameNode
method createLocation (line 1618) | protected function createLocation(Token $start): ?Location
method createLexer (line 1634) | protected function createLexer($source, array $options): LexerInterface
method peek (line 1645) | protected function peek(string $kind): bool
method skip (line 1657) | protected function skip(string $kind): bool
method expect (line 1674) | protected function expect(string $kind): Token
method expectKeyword (line 1691) | protected function expectKeyword(string $value): Token
method unexpected (line 1710) | protected function unexpected(?Token $atToken = null): SyntaxErrorExce...
method any (line 1729) | protected function any(string $openKind, callable $parseFunction, stri...
method many (line 1754) | protected function many(string $openKind, callable $parseFunction, str...
FILE: src/Language/ParserInterface.php
type ParserInterface (line 44) | interface ParserInterface
method parse (line 53) | public function parse(Source $source, array $options = []): DocumentNode;
FILE: src/Language/PrintException.php
class PrintException (line 7) | class PrintException extends AbstractException
FILE: src/Language/Source.php
class Source (line 15) | class Source
method __construct (line 41) | public function __construct(string $body, ?string $name = 'GraphQL req...
method getBodyLength (line 52) | public function getBodyLength(): int
method getBody (line 60) | public function getBody(): string
method getName (line 68) | public function getName(): string
method getLocationOffset (line 76) | public function getLocationOffset(): ?SourceLocation
method setBody (line 85) | protected function setBody(string $body): Source
method setName (line 95) | protected function setName(string $name): Source
method setLocationOffset (line 106) | protected function setLocationOffset(?SourceLocation $locationOffset):...
FILE: src/Language/SourceBuilderInterface.php
type SourceBuilderInterface (line 9) | interface SourceBuilderInterface
method build (line 15) | public function build(): Source;
FILE: src/Language/SourceLocation.php
class SourceLocation (line 8) | class SourceLocation implements SerializationInterface
method __construct (line 28) | public function __construct(int $line = 1, int $column = 1)
method getLine (line 37) | public function getLine(): int
method getColumn (line 45) | public function getColumn(): int
method fromSource (line 55) | public static function fromSource(Source $source, int $position): self
method toArray (line 74) | public function toArray(): array
FILE: src/Language/StringSourceBuilder.php
class StringSourceBuilder (line 5) | class StringSourceBuilder implements SourceBuilderInterface
method __construct (line 17) | public function __construct(string $body)
method build (line 25) | public function build(): Source
FILE: src/Language/SyntaxErrorException.php
class SyntaxErrorException (line 7) | class SyntaxErrorException extends GraphQLException
method __construct (line 15) | public function __construct(Source $source, int $position, string $des...
FILE: src/Language/Token.php
class Token (line 8) | class Token implements SerializationInterface
method __construct (line 63) | public function __construct(
method getKind (line 84) | public function getKind(): string
method getStart (line 92) | public function getStart(): int
method getEnd (line 100) | public function getEnd(): int
method getLine (line 108) | public function getLine(): int
method getColumn (line 116) | public function getColumn(): int
method getPrev (line 124) | public function getPrev(): ?Token
method getNext (line 132) | public function getNext(): ?Token
method getValue (line 140) | public function getValue(): ?string
method setNext (line 149) | public function setNext(?Token $next)
method toArray (line 158) | public function toArray(): array
method __toString (line 171) | public function __toString(): string
FILE: src/Language/TokenKindEnum.php
class TokenKindEnum (line 5) | class TokenKindEnum
method values (line 35) | public static function values(): array
FILE: src/Language/Visitor/ParallelVisitor.php
class ParallelVisitor (line 7) | class ParallelVisitor implements VisitorInterface
method __construct (line 23) | public function __construct($visitors)
method enterNode (line 31) | public function enterNode(NodeInterface $node): VisitorResult
method leaveNode (line 56) | public function leaveNode(NodeInterface $node): VisitorResult
FILE: src/Language/Visitor/SpecificKindVisitor.php
class SpecificKindVisitor (line 50) | class SpecificKindVisitor implements VisitorInterface
method enterNode (line 55) | public function enterNode(NodeInterface $node): VisitorResult
method leaveNode (line 64) | public function leaveNode(NodeInterface $node): VisitorResult
method enterArgument (line 74) | protected function enterArgument(ArgumentNode $node): VisitorResult
method leaveArgument (line 83) | protected function leaveArgument(ArgumentNode $node): VisitorResult
method enterBooleanValue (line 92) | protected function enterBooleanValue(BooleanValueNode $node): VisitorR...
method leaveBooleanValue (line 101) | protected function leaveBooleanValue(BooleanValueNode $node): VisitorR...
method enterDirectiveDefinition (line 110) | protected function enterDirectiveDefinition(DirectiveDefinitionNode $n...
method leaveDirectiveDefinition (line 119) | protected function leaveDirectiveDefinition(DirectiveDefinitionNode $n...
method enterDirective (line 128) | protected function enterDirective(DirectiveNode $node): VisitorResult
method leaveDirective (line 137) | protected function leaveDirective(DirectiveNode $node): VisitorResult
method enterDocument (line 146) | protected function enterDocument(DocumentNode $node): VisitorResult
method leaveDocument (line 155) | protected function leaveDocument(DocumentNode $node): VisitorResult
method enterEnumTypeDefinition (line 164) | protected function enterEnumTypeDefinition(EnumTypeDefinitionNode $nod...
method leaveEnumTypeDefinition (line 173) | protected function leaveEnumTypeDefinition(EnumTypeDefinitionNode $nod...
method enterEnumTypeExtension (line 182) | protected function enterEnumTypeExtension(EnumTypeExtensionNode $node)...
method leaveEnumTypeExtension (line 191) | protected function leaveEnumTypeExtension(EnumTypeExtensionNode $node)...
method enterEnumValueDefinition (line 200) | protected function enterEnumValueDefinition(EnumValueDefinitionNode $n...
method leaveEnumValueDefinition (line 209) | protected function leaveEnumValueDefinition(EnumValueDefinitionNode $n...
method enterEnumValue (line 218) | protected function enterEnumValue(EnumValueNode $node): VisitorResult
method leaveEnumValue (line 227) | protected function leaveEnumValue(EnumValueNode $node): VisitorResult
method enterFieldDefinition (line 236) | protected function enterFieldDefinition(FieldDefinitionNode $node): Vi...
method leaveFieldDefinition (line 245) | protected function leaveFieldDefinition(FieldDefinitionNode $node): Vi...
method enterField (line 254) | protected function enterField(FieldNode $node): VisitorResult
method leaveField (line 263) | protected function leaveField(FieldNode $node): VisitorResult
method enterFloatValue (line 272) | protected function enterFloatValue(FloatValueNode $node): VisitorResult
method leaveFloatValue (line 281) | protected function leaveFloatValue(FloatValueNode $node): VisitorResult
method enterFragmentDefinition (line 290) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
method leaveFragmentDefinition (line 299) | protected function leaveFragmentDefinition(FragmentDefinitionNode $nod...
method enterFragmentSpread (line 308) | protected function enterFragmentSpread(FragmentSpreadNode $node): Visi...
method leaveFragmentSpread (line 317) | protected function leaveFragmentSpread(FragmentSpreadNode $node): Visi...
method enterInlineFragment (line 326) | protected function enterInlineFragment(InlineFragmentNode $node): Visi...
method leaveInlineFragment (line 335) | protected function leaveInlineFragment(InlineFragmentNode $node): Visi...
method enterInputObjectTypeDefinition (line 344) | protected function enterInputObjectTypeDefinition(InputObjectTypeDefin...
method leaveInputObjectTypeDefinition (line 353) | protected function leaveInputObjectTypeDefinition(InputObjectTypeDefin...
method enterInputObjectTypeExtension (line 362) | protected function enterInputObjectTypeExtension(InputObjectTypeExtens...
method leaveInputObjectTypeExtension (line 371) | protected function leaveInputObjectTypeExtension(InputObjectTypeExtens...
method enterInputValueDefinition (line 380) | protected function enterInputValueDefinition(InputValueDefinitionNode ...
method leaveInputValueDefinition (line 389) | protected function leaveInputValueDefinition(InputValueDefinitionNode ...
method enterIntValue (line 398) | protected function enterIntValue(IntValueNode $node): VisitorResult
method leaveIntValue (line 407) | protected function leaveIntValue(IntValueNode $node): VisitorResult
method enterInterfaceTypeDefinition (line 416) | protected function enterInterfaceTypeDefinition(InterfaceTypeDefinitio...
method leaveInterfaceTypeDefinition (line 425) | protected function leaveInterfaceTypeDefinition(InterfaceTypeDefinitio...
method enterInterfaceTypeExtension (line 434) | protected function enterInterfaceTypeExtension(InterfaceTypeExtensionN...
method leaveInterfaceTypeExtension (line 443) | protected function leaveInterfaceTypeExtension(InterfaceTypeExtensionN...
method enterListType (line 452) | protected function enterListType(ListTypeNode $node): VisitorResult
method leaveListType (line 461) | protected function leaveListType(ListTypeNode $node): VisitorResult
method enterListValue (line 470) | protected function enterListValue(ListValueNode $node): VisitorResult
method leaveListValue (line 479) | protected function leaveListValue(ListValueNode $node): VisitorResult
method enterNamedType (line 488) | protected function enterNamedType(NamedTypeNode $node): VisitorResult
method leaveNamedType (line 497) | protected function leaveNamedType(NamedTypeNode $node): VisitorResult
method enterName (line 506) | protected function enterName(NameNode $node): VisitorResult
method leaveName (line 515) | protected function leaveName(NameNode $node): VisitorResult
method enterNonNullType (line 524) | protected function enterNonNullType(NonNullTypeNode $node): VisitorResult
method leaveNonNullType (line 533) | protected function leaveNonNullType(NonNullTypeNode $node): VisitorResult
method enterNullValue (line 542) | protected function enterNullValue(NullValueNode $node): VisitorResult
method leaveNullValue (line 551) | protected function leaveNullValue(NullValueNode $node): VisitorResult
method enterObjectField (line 560) | protected function enterObjectField(ObjectFieldNode $node): VisitorResult
method leaveObjectField (line 569) | protected function leaveObjectField(ObjectFieldNode $node): VisitorResult
method enterObjectTypeDefinition (line 578) | protected function enterObjectTypeDefinition(ObjectTypeDefinitionNode ...
method leaveObjectTypeDefinition (line 587) | protected function leaveObjectTypeDefinition(ObjectTypeDefinitionNode ...
method enterObjectTypeExtension (line 596) | protected function enterObjectTypeExtension(ObjectTypeExtensionNode $n...
method leaveObjectTypeExtension (line 605) | protected function leaveObjectTypeExtension(ObjectTypeExtensionNode $n...
method enterObjectValue (line 614) | protected function enterObjectValue(ObjectValueNode $node): VisitorResult
method leaveObjectValue (line 623) | protected function leaveObjectValue(ObjectValueNode $node): VisitorResult
method enterOperationDefinition (line 632) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method leaveOperationDefinition (line 641) | protected function leaveOperationDefinition(OperationDefinitionNode $n...
method enterOperationTypeDefinition (line 650) | protected function enterOperationTypeDefinition(OperationTypeDefinitio...
method leaveOperationTypeDefinition (line 659) | protected function leaveOperationTypeDefinition(OperationTypeDefinitio...
method enterScalarTypeDefinition (line 668) | protected function enterScalarTypeDefinition(ScalarTypeDefinitionNode ...
method leaveScalarTypeDefinition (line 677) | protected function leaveScalarTypeDefinition(ScalarTypeDefinitionNode ...
method enterScalarTypeExtension (line 686) | protected function enterScalarTypeExtension(ScalarTypeExtensionNode $n...
method leaveScalarTypeExtension (line 695) | protected function leaveScalarTypeExtension(ScalarTypeExtensionNode $n...
method enterSchemaDefinition (line 704) | protected function enterSchemaDefinition(SchemaDefinitionNode $node): ...
method leaveSchemaDefinition (line 713) | protected function leaveSchemaDefinition(SchemaDefinitionNode $node): ...
method enterSchemaExtension (line 722) | protected function enterSchemaExtension(SchemaExtensionNode $node): Vi...
method leaveSchemaExtension (line 731) | protected function leaveSchemaExtension(SchemaExtensionNode $node): Vi...
method enterSelectionSet (line 740) | protected function enterSelectionSet(SelectionSetNode $node): VisitorR...
method leaveSelectionSet (line 749) | protected function leaveSelectionSet(SelectionSetNode $node): VisitorR...
method enterStringValue (line 758) | protected function enterStringValue(StringValueNode $node): VisitorResult
method leaveStringValue (line 767) | protected function leaveStringValue(StringValueNode $node): VisitorResult
method enterUnionTypeDefinition (line 776) | protected function enterUnionTypeDefinition(UnionTypeDefinitionNode $n...
method leaveUnionTypeDefinition (line 785) | protected function leaveUnionTypeDefinition(UnionTypeDefinitionNode $n...
method enterUnionTypeExtension (line 794) | protected function enterUnionTypeExtension(UnionTypeExtensionNode $nod...
method leaveUnionTypeExtension (line 803) | protected function leaveUnionTypeExtension(UnionTypeExtensionNode $nod...
method enterVariableDefinition (line 812) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
method leaveVariableDefinition (line 821) | protected function leaveVariableDefinition(VariableDefinitionNode $nod...
method enterVariable (line 830) | protected function enterVariable(VariableNode $node): VisitorResult
method leaveVariable (line 839) | protected function leaveVariable(VariableNode $node): VisitorResult
FILE: src/Language/Visitor/TypeInfoVisitor.php
class TypeInfoVisitor (line 33) | class TypeInfoVisitor implements VisitorInterface
method __construct (line 50) | public function __construct(TypeInfo $typeInfo, VisitorInterface $visi...
method enterNode (line 62) | public function enterNode(NodeInterface $node): VisitorResult
method leaveNode (line 160) | public function leaveNode(NodeInterface $node): VisitorResult
FILE: src/Language/Visitor/Visitor.php
class Visitor (line 7) | class Visitor implements VisitorInterface
method __construct (line 25) | public function __construct(?callable $enterCallback = null, ?callable...
method enterNode (line 34) | public function enterNode(NodeInterface $node): VisitorResult
method leaveNode (line 44) | public function leaveNode(NodeInterface $node): VisitorResult
FILE: src/Language/Visitor/VisitorBreak.php
class VisitorBreak (line 5) | class VisitorBreak extends \Exception
FILE: src/Language/Visitor/VisitorInfo.php
class VisitorInfo (line 7) | class VisitorInfo
method __construct (line 42) | public function __construct(
method addOneToPath (line 60) | public function addOneToPath(string $key)
method removeOneFromPath (line 68) | public function removeOneFromPath()
method addAncestor (line 77) | public function addAncestor(NodeInterface $node)
method removeAncestor (line 85) | public function removeAncestor()
method getAncestor (line 93) | public function getAncestor(int $depth = 1): ?NodeInterface
method getVisitor (line 107) | public function getVisitor(): VisitorInterface
method getKey (line 115) | public function getKey()
method getParent (line 123) | public function getParent(): ?NodeInterface
method getPath (line 131) | public function getPath(): array
method getAncestors (line 139) | public function getAncestors(): array
FILE: src/Language/Visitor/VisitorInterface.php
type VisitorInterface (line 7) | interface VisitorInterface
method enterNode (line 13) | public function enterNode(NodeInterface $node): VisitorResult;
method leaveNode (line 19) | public function leaveNode(NodeInterface $node): VisitorResult;
FILE: src/Language/Visitor/VisitorResult.php
class VisitorResult (line 7) | class VisitorResult
method __construct (line 28) | public function __construct(?NodeInterface $value = null, string $acti...
method getValue (line 37) | public function getValue(): ?NodeInterface
method getAction (line 45) | public function getAction(): string
method setAction (line 54) | public function setAction(string $action): self
FILE: src/Language/blockStringValue.php
function blockStringValue (line 13) | function blockStringValue(string $rawString): string
function leadingWhitespace (line 54) | function leadingWhitespace(string $string): int
function isBlank (line 70) | function isBlank(string $string): bool
FILE: src/Language/utils.php
function printCharCode (line 11) | function printCharCode(int $code): string
function sliceString (line 30) | function sliceString(string $string, int $start, int $end = null): string
function isLetter (line 40) | function isLetter(int $code): bool
function isNumber (line 49) | function isNumber(int $code): bool
function isUnderscore (line 58) | function isUnderscore(int $code): bool
function isAlphaNumeric (line 67) | function isAlphaNumeric(int $code): bool
function isLineTerminator (line 76) | function isLineTerminator(int $code): bool
function isSourceCharacter (line 85) | function isSourceCharacter(int $code): bool
function isOperation (line 94) | function isOperation(string $value): bool
function locationShorthandToArray (line 103) | function locationShorthandToArray(array $location): ?array
function locationsShorthandToArray (line 112) | function locationsShorthandToArray(array $locations): array
function block (line 123) | function block(array $array): string
function wrap (line 134) | function wrap(string $start, ?string $maybeString = null, ?string $end =...
function indent (line 143) | function indent(?string $maybeString): string
function dedent (line 152) | function dedent(string $str): string
function printBlockString (line 167) | function printBlockString(string $value, string $indentation = '', bool ...
FILE: src/Schema/Building/BuildInfo.php
class BuildInfo (line 12) | class BuildInfo
method __construct (line 47) | public function __construct(
method getTypeDefinition (line 65) | public function getTypeDefinition(string $typeName): ?TypeNodeInterface
method getOperationTypeDefinition (line 74) | public function getOperationTypeDefinition(string $operation): ?NodeIn...
method getDocument (line 86) | public function getDocument(): DocumentNode
method getSchemaDefinition (line 94) | public function getSchemaDefinition(): ?SchemaDefinitionNode
method getTypeDefinitionMap (line 102) | public function getTypeDefinitionMap(): array
method getDirectiveDefinitions (line 110) | public function getDirectiveDefinitions(): array
FILE: src/Schema/Building/BuildingContext.php
class BuildingContext (line 15) | class BuildingContext implements BuildingContextInterface
method __construct (line 38) | public function __construct(
method buildQueryType (line 51) | public function buildQueryType(): ?TypeInterface
method buildMutationType (line 60) | public function buildMutationType(): ?TypeInterface
method buildSubscriptionType (line 69) | public function buildSubscriptionType(): ?TypeInterface
method buildTypes (line 78) | public function buildTypes(): array
method buildDirectives (line 88) | public function buildDirectives(): array
method getSchemaDefinition (line 114) | public function getSchemaDefinition(): ?SchemaDefinitionNode
FILE: src/Schema/Building/BuildingContextInterface.php
type BuildingContextInterface (line 9) | interface BuildingContextInterface
method buildQueryType (line 14) | public function buildQueryType(): ?TypeInterface;
method buildMutationType (line 19) | public function buildMutationType(): ?TypeInterface;
method buildSubscriptionType (line 24) | public function buildSubscriptionType(): ?TypeInterface;
method buildTypes (line 29) | public function buildTypes(): array;
method buildDirectives (line 34) | public function buildDirectives(): array;
method getSchemaDefinition (line 39) | public function getSchemaDefinition(): ?SchemaDefinitionNode;
FILE: src/Schema/Building/SchemaBuilder.php
class SchemaBuilder (line 16) | class SchemaBuilder implements SchemaBuilderInterface
method build (line 21) | public function build(
method createContext (line 48) | protected function createContext(
method createInfo (line 71) | protected function createInfo(DocumentNode $document): BuildInfo
method getOperationTypeDefinitions (line 121) | protected function getOperationTypeDefinitions(SchemaDefinitionNode $n...
FILE: src/Schema/Building/SchemaBuilderInterface.php
type SchemaBuilderInterface (line 9) | interface SchemaBuilderInterface
method build (line 17) | public function build(
FILE: src/Schema/Building/SchemaBuildingException.php
class SchemaBuildingException (line 7) | class SchemaBuildingException extends GraphQLException
FILE: src/Schema/Building/SchemaBuildingProvider.php
class SchemaBuildingProvider (line 7) | class SchemaBuildingProvider extends AbstractServiceProvider
method register (line 19) | public function register()
FILE: src/Schema/DefinitionBuilder.php
class DefinitionBuilder (line 52) | class DefinitionBuilder implements DefinitionBuilderInterface
method __construct (line 87) | public function __construct(
method buildTypes (line 105) | public function buildTypes(array $nodes): array
method buildType (line 115) | public function buildType(NamedTypeNodeInterface $node): NamedTypeInte...
method buildDirective (line 141) | public function buildDirective(DirectiveDefinitionNode $node): Directive
method buildField (line 166) | public function buildField($node, ?callable $resolve = null): array
method buildWrappedType (line 185) | protected function buildWrappedType(TypeNodeInterface $typeNode): Type...
method buildWrappedTypeRecursive (line 199) | protected function buildWrappedTypeRecursive(
method registerTypes (line 217) | protected function registerTypes(array $customTypes)
method registerDirectives (line 234) | protected function registerDirectives(array $customDirectives)
method buildArguments (line 252) | protected function buildArguments(array $nodes): array
method buildNamedType (line 278) | protected function buildNamedType(TypeNodeInterface $node): NamedTypeI...
method buildObjectType (line 307) | protected function buildObjectType(ObjectTypeDefinitionNode $node): Ob...
method buildFields (line 332) | protected function buildFields($node): array
method getFieldResolver (line 353) | protected function getFieldResolver(string $typeName, string $fieldNam...
method buildInterfaceType (line 364) | protected function buildInterfaceType(InterfaceTypeDefinitionNode $nod...
method buildEnumType (line 382) | protected function buildEnumType(EnumTypeDefinitionNode $node): EnumType
method buildUnionType (line 409) | protected function buildUnionType(UnionTypeDefinitionNode $node): Unio...
method getTypeResolver (line 427) | protected function getTypeResolver(string $typeName): ?callable
method buildScalarType (line 438) | protected function buildScalarType(ScalarTypeDefinitionNode $node): Sc...
method buildInputObjectType (line 456) | protected function buildInputObjectType(InputObjectTypeDefinitionNode ...
method resolveType (line 489) | protected function resolveType(NamedTypeNode $node): NamedTypeInterface
method defaultTypeResolver (line 498) | public function defaultTypeResolver(NamedTypeNode $node): ?NamedTypeIn...
method getTypeDefinition (line 507) | protected function getTypeDefinition(string $typeName): ?NamedTypeNode...
method getNamedTypeNode (line 516) | protected function getNamedTypeNode(TypeNodeInterface $typeNode): Name...
method getDeprecationReason (line 534) | protected function getDeprecationReason(NodeInterface $node): ?string
FILE: src/Schema/DefinitionBuilderInterface.php
type DefinitionBuilderInterface (line 14) | interface DefinitionBuilderInterface
method buildTypes (line 20) | public function buildTypes(array $nodes): array;
method buildType (line 26) | public function buildType(NamedTypeNodeInterface $node): NamedTypeInte...
method buildDirective (line 32) | public function buildDirective(DirectiveDefinitionNode $node): Directive;
method buildField (line 41) | public function buildField($node, ?callable $resolve = null): array;
FILE: src/Schema/DefinitionInterface.php
type DefinitionInterface (line 8) | interface DefinitionInterface
FILE: src/Schema/DefinitionPrinter.php
class DefinitionPrinter (line 31) | class DefinitionPrinter implements DefinitionPrinterInterface
method printSchema (line 43) | public function printSchema(Schema $schema, array $options = []): string
method printIntrospectionSchema (line 63) | public function printIntrospectionSchema(Schema $schema, array $option...
method print (line 84) | public function print(DefinitionInterface $definition): string
method printFilteredSchema (line 109) | protected function printFilteredSchema(
method getSchemaDirectives (line 129) | protected function getSchemaDirectives(Schema $schema, callable $filte...
method getSchemaTypes (line 139) | protected function getSchemaTypes(Schema $schema, callable $filter): a...
method printSchemaDefinition (line 154) | protected function printSchemaDefinition(Schema $definition): string
method isSchemaOfCommonNames (line 197) | protected function isSchemaOfCommonNames(Schema $schema): bool
method printDirectiveDefinition (line 221) | public function printDirectiveDefinition(Directive $directive): string
method printType (line 240) | protected function printType(NamedTypeInterface $type): string
method printScalarType (line 268) | protected function printScalarType(ScalarType $type): string
method printObjectType (line 281) | protected function printObjectType(ObjectType $type): string
method printInterfaceType (line 305) | protected function printInterfaceType(InterfaceType $type): string
method printUnionType (line 323) | protected function printUnionType(UnionType $type): string
method printEnumType (line 339) | protected function printEnumType(EnumType $type): string
method printEnumValues (line 356) | protected function printEnumValues(array $values): string
method printInputObjectType (line 381) | protected function printInputObjectType(InputObjectType $type): string
method printInputValue (line 408) | protected function printInputValue(InputValueInterface $inputValue): s...
method printFields (line 426) | protected function printFields(array $fields): string
method printArguments (line 452) | protected function printArguments(array $arguments, string $indentatio...
method printDeprecated (line 490) | protected function printDeprecated(DeprecationAwareInterface $fieldOrE...
method printDescription (line 513) | protected function printDescription(
method printDescriptionWithComments (line 543) | protected function printDescriptionWithComments(array $lines, string $...
method printOne (line 563) | protected function printOne(DefinitionInterface $definition): string
method printMany (line 572) | protected function printMany(array $definitions): array
FILE: src/Schema/DefinitionPrinterInterface.php
type DefinitionPrinterInterface (line 5) | interface DefinitionPrinterInterface
method printSchema (line 19) | public function printSchema(Schema $schema, array $options = []): string;
method printIntrospectionSchema (line 33) | public function printIntrospectionSchema(Schema $schema, array $option...
method print (line 46) | public function print(DefinitionInterface $definition): string;
FILE: src/Schema/Extension/ExtendInfo.php
class ExtendInfo (line 13) | class ExtendInfo
method __construct (line 54) | public function __construct(
method hasTypeExtensions (line 74) | public function hasTypeExtensions(string $typeName): bool
method getTypeExtensions (line 83) | public function getTypeExtensions(string $typeName): array
method getSchema (line 91) | public function getSchema(): Schema
method getDocument (line 99) | public function getDocument(): DocumentNode
method hasTypeDefinitionMap (line 107) | public function hasTypeDefinitionMap(): bool
method getTypeDefinitionMap (line 115) | public function getTypeDefinitionMap(): array
method hasTypeExtensionsMap (line 123) | public function hasTypeExtensionsMap(): bool
method getTypeExtensionsMap (line 131) | public function getTypeExtensionsMap()
method hasDirectiveDefinitions (line 139) | public function hasDirectiveDefinitions(): bool
method getDirectiveDefinitions (line 147) | public function getDirectiveDefinitions(): array
method hasSchemaExtensions (line 155) | public function hasSchemaExtensions(): bool
method getSchemaExtensions (line 163) | public function getSchemaExtensions(): array
FILE: src/Schema/Extension/ExtensionContext.php
class ExtensionContext (line 26) | class ExtensionContext implements ExtensionContextInterface
method __construct (line 47) | public function __construct(ExtendInfo $info)
method isSchemaExtended (line 55) | public function isSchemaExtended(): bool
method getExtendedOperationTypes (line 69) | public function getExtendedOperationTypes(): array
method getExtendedQueryType (line 97) | protected function getExtendedQueryType(): ?TypeInterface
method getExtendedMutationType (line 110) | protected function getExtendedMutationType(): ?TypeInterface
method getExtendedSubscriptionType (line 123) | protected function getExtendedSubscriptionType(): ?TypeInterface
method getExtendedTypes (line 135) | public function getExtendedTypes(): array
method getExtendedDirectives (line 151) | public function getExtendedDirectives(): array
method setDefinitionBuilder (line 171) | public function setDefinitionBuilder(DefinitionBuilderInterface $defin...
method resolveType (line 183) | public function resolveType(NamedTypeNode $node): ?TypeInterface
method getExtendedType (line 207) | protected function getExtendedType(NamedTypeInterface $type): TypeInte...
method extendType (line 223) | protected function extendType(TypeInterface $type): TypeInterface
method extendObjectType (line 252) | protected function extendObjectType(ObjectType $type): ObjectType
method extendInterfaceType (line 281) | protected function extendInterfaceType(InterfaceType $type): Interface...
method extendExtensionASTNodes (line 307) | protected function extendExtensionASTNodes(string $typeName, array $no...
method extendUnionType (line 318) | protected function extendUnionType(UnionType $type): UnionType
method extendImplementedInterfaces (line 336) | protected function extendImplementedInterfaces(ObjectType $type): array
method extendFieldMap (line 366) | protected function extendFieldMap(FieldsAwareInterface $type): array
method extendFieldType (line 416) | protected function extendFieldType(TypeInterface $typeDefinition): Typ...
FILE: src/Schema/Extension/ExtensionContextInterface.php
type ExtensionContextInterface (line 8) | interface ExtensionContextInterface
method isSchemaExtended (line 13) | public function isSchemaExtended(): bool;
method getExtendedOperationTypes (line 18) | public function getExtendedOperationTypes(): array;
method getExtendedTypes (line 23) | public function getExtendedTypes(): array;
method getExtendedDirectives (line 28) | public function getExtendedDirectives(): array;
FILE: src/Schema/Extension/SchemaExtender.php
class SchemaExtender (line 27) | class SchemaExtender implements SchemaExtenderInterface
method extend (line 32) | public function extend(
method createContext (line 62) | protected function createContext(
method createInfo (line 93) | protected function createInfo(Schema $schema, DocumentNode $document):...
method checkExtensionNode (line 202) | protected function checkExtensionNode(TypeInterface $type, NodeInterfa...
FILE: src/Schema/Extension/SchemaExtenderInterface.php
type SchemaExtenderInterface (line 9) | interface SchemaExtenderInterface
method extend (line 18) | public function extend(
FILE: src/Schema/Extension/SchemaExtensionException.php
class SchemaExtensionException (line 7) | class SchemaExtensionException extends GraphQLException
FILE: src/Schema/Extension/SchemaExtensionProvider.php
class SchemaExtensionProvider (line 7) | class SchemaExtensionProvider extends AbstractServiceProvider
method register (line 19) | public function register()
FILE: src/Schema/Resolver/AbstractFieldResolver.php
class AbstractFieldResolver (line 7) | abstract class AbstractFieldResolver implements ResolverInterface
method resolve (line 18) | abstract public function resolve($rootValue, array $arguments, $contex...
method __invoke (line 23) | public function __invoke()
method getResolveCallback (line 31) | public function getResolveCallback(): ?callable
FILE: src/Schema/Resolver/AbstractTypeResolver.php
class AbstractTypeResolver (line 5) | abstract class AbstractTypeResolver implements ResolverCollectionInterface
method getResolveCallback (line 12) | public function getResolveCallback(): ?callable
method getResolver (line 23) | public function getResolver(string $fieldName): ?callable
FILE: src/Schema/Resolver/ResolverCollectionInterface.php
type ResolverCollectionInterface (line 5) | interface ResolverCollectionInterface extends ResolverInterface
method getResolver (line 11) | public function getResolver(string $fieldName): ?callable;
FILE: src/Schema/Resolver/ResolverInterface.php
type ResolverInterface (line 5) | interface ResolverInterface
method getResolveCallback (line 10) | public function getResolveCallback(): ?callable;
method getTypeResolver (line 15) | public function getTypeResolver(): ?callable;
method getMiddleware (line 20) | public function getMiddleware(): ?array;
FILE: src/Schema/Resolver/ResolverMap.php
class ResolverMap (line 5) | class ResolverMap implements ResolverCollectionInterface
method __construct (line 18) | public function __construct(array $resolvers)
method addResolver (line 27) | public function addResolver(string $fieldName, callable $resolver)
method getResolver (line 36) | public function getResolver(string $fieldName): ?callable
method getResolveCallback (line 44) | public function getResolveCallback(): ?callable
method getTypeResolver (line 58) | public function getTypeResolver(): ?callable
method getMiddleware (line 66) | public function getMiddleware(): ?array
method registerResolvers (line 74) | protected function registerResolvers(array $resolvers): void
FILE: src/Schema/Resolver/ResolverMiddlewareInterface.php
type ResolverMiddlewareInterface (line 7) | interface ResolverMiddlewareInterface
method resolve (line 17) | public function resolve(
FILE: src/Schema/Resolver/ResolverRegistry.php
class ResolverRegistry (line 7) | class ResolverRegistry implements ResolverRegistryInterface
method __construct (line 24) | public function __construct(array $resolvers = [], ?array $middleware ...
method register (line 34) | public function register(string $typeName, ResolverInterface $resolver...
method getFieldResolver (line 42) | public function getFieldResolver(string $typeName, string $fieldName):...
method getTypeResolver (line 72) | public function getTypeResolver(string $typeName): ?callable
method getResolver (line 86) | public function getResolver(string $typeName): ?ResolverInterface
method registerResolvers (line 94) | protected function registerResolvers(array $resolvers): void
method getMiddlewareToApply (line 110) | protected function getMiddlewareToApply(ResolverInterface $resolver, a...
method applyMiddleware (line 128) | protected function applyMiddleware(callable $resolveCallback, array $m...
FILE: src/Schema/Resolver/ResolverRegistryInterface.php
type ResolverRegistryInterface (line 5) | interface ResolverRegistryInterface
method register (line 11) | public function register(string $typeName, ResolverInterface $resolver...
method getFieldResolver (line 18) | public function getFieldResolver(string $typeName, string $fieldName):...
method getTypeResolver (line 24) | public function getTypeResolver(string $typeName): ?callable;
method getResolver (line 30) | public function getResolver(string $typeName): ?ResolverInterface;
FILE: src/Schema/Resolver/ResolverTrait.php
type ResolverTrait (line 7) | trait ResolverTrait
method getTypeResolver (line 12) | public function getTypeResolver(): ?callable
method resolveType (line 25) | public function resolveType($rootValue, $context = null, ?ResolveInfo ...
method getMiddleware (line 34) | public function getMiddleware(): ?array
FILE: src/Schema/Schema.php
class Schema (line 48) | class Schema implements DefinitionInterface
method __construct (line 111) | public function __construct(
method getQueryType (line 139) | public function getQueryType(): ?ObjectType
method getMutationType (line 147) | public function getMutationType(): ?ObjectType
method getSubscriptionType (line 155) | public function getSubscriptionType(): ?ObjectType
method getDirective (line 164) | public function getDirective(string $name): ?Directive
method getDirectives (line 174) | public function getDirectives(): array
method getTypeMap (line 182) | public function getTypeMap(): array
method getAssumeValid (line 190) | public function getAssumeValid(): bool
method isPossibleType (line 201) | public function isPossibleType(NamedTypeInterface $abstractType, Named...
method getPossibleTypes (line 236) | public function getPossibleTypes(NamedTypeInterface $abstractType): ?a...
method getType (line 249) | public function getType(string $name): ?TypeInterface
method buildTypeMap (line 257) | protected function buildTypeMap(): void
method buildImplementations (line 286) | protected function buildImplementations(): void
method typeMapReducer (line 318) | protected function typeMapReducer(array $map, ?TypeInterface $type): a...
method typeMapDirectiveReducer (line 386) | protected function typeMapDirectiveReducer(array $map, Directive $dire...
FILE: src/Schema/Validation/Rule/AbstractRule.php
class AbstractRule (line 7) | abstract class AbstractRule implements RuleInterface
method setContext (line 18) | public function setContext(ValidationContextInterface $context)
FILE: src/Schema/Validation/Rule/DirectivesRule.php
class DirectivesRule (line 14) | class DirectivesRule extends AbstractRule
method evaluate (line 20) | public function evaluate(): void
method getAllDirectiveArgumentNodes (line 91) | protected function getAllDirectiveArgumentNodes(Directive $directive, ...
method validateName (line 112) | protected function validateName($node): void
FILE: src/Schema/Validation/Rule/RootTypesRule.php
class RootTypesRule (line 9) | class RootTypesRule extends AbstractRule
method evaluate (line 14) | public function evaluate(): void
method validateRootType (line 33) | protected function validateRootType(?NamedTypeInterface $rootType, str...
FILE: src/Schema/Validation/Rule/RuleInterface.php
type RuleInterface (line 7) | interface RuleInterface
method setContext (line 13) | public function setContext(ValidationContextInterface $context);
method evaluate (line 18) | public function evaluate(): void;
FILE: src/Schema/Validation/Rule/SupportedRules.php
class SupportedRules (line 7) | class SupportedRules
method build (line 23) | public static function build(): array
FILE: src/Schema/Validation/Rule/TypesRule.php
class TypesRule (line 35) | class TypesRule extends AbstractRule
method evaluate (line 42) | public function evaluate(): void
method validateFields (line 102) | protected function validateFields(FieldsAwareInterface $type): void
method validateObjectInterfaces (line 201) | protected function validateObjectInterfaces(ObjectType $objectType): void
method validateObjectImplementsInterface (line 247) | protected function validateObjectImplementsInterface(ObjectType $objec...
method validateUnionMembers (line 395) | protected function validateUnionMembers(UnionType $unionType): void
method validateEnumValues (line 448) | protected function validateEnumValues(EnumType $enumType): void
method validateInputFields (line 498) | protected function validateInputFields(InputObjectType $inputObjectTyp...
method getAllObjectOrInterfaceNodes (line 540) | protected function getAllObjectOrInterfaceNodes(FieldsAwareInterface $...
method getFieldTypeNode (line 559) | protected function getFieldTypeNode(FieldsAwareInterface $type, string...
method getFieldNode (line 570) | protected function getFieldNode(FieldsAwareInterface $type, string $fi...
method getAllFieldNodes (line 580) | protected function getAllFieldNodes(FieldsAwareInterface $type, string...
method getFieldArgumentNode (line 601) | protected function getFieldArgumentNode(
method getAllFieldArgumentNodes (line 615) | protected function getAllFieldArgumentNodes(
method getImplementsInterfaceNode (line 640) | protected function getImplementsInterfaceNode(ObjectType $type, string...
method getAllImplementsInterfaceNodes (line 650) | protected function getAllImplementsInterfaceNodes(ObjectType $type, st...
method getFieldArgumentTypeNode (line 671) | protected function getFieldArgumentTypeNode(
method getUnionMemberTypeNodes (line 685) | protected function getUnionMemberTypeNodes(UnionType $unionType, strin...
method getEnumValueNodes (line 704) | protected function getEnumValueNodes(EnumType $enumType, string $value...
method validateName (line 721) | protected function validateName($node): void
FILE: src/Schema/Validation/SchemaValidationException.php
class SchemaValidationException (line 8) | class SchemaValidationException extends GraphQLException implements Vali...
FILE: src/Schema/Validation/SchemaValidationProvider.php
class SchemaValidationProvider (line 10) | class SchemaValidationProvider extends AbstractServiceProvider
method register (line 25) | public function register()
FILE: src/Schema/Validation/SchemaValidator.php
class SchemaValidator (line 10) | class SchemaValidator implements SchemaValidatorInterface
method validate (line 17) | public function validate(Schema $schema, ?array $rules = null): array
method createContext (line 33) | public function createContext(Schema $schema): ValidationContextInterface
FILE: src/Schema/Validation/SchemaValidatorInterface.php
type SchemaValidatorInterface (line 8) | interface SchemaValidatorInterface
method validate (line 15) | public function validate(Schema $schema, ?array $rules = null): array;
method createContext (line 21) | public function createContext(Schema $schema): ValidationContextInterf...
FILE: src/Schema/Validation/ValidationContext.php
class ValidationContext (line 8) | class ValidationContext implements ValidationContextInterface
method __construct (line 24) | public function __construct(Schema $schema)
method reportError (line 32) | public function reportError(ValidationExceptionInterface $error): void
method getErrors (line 40) | public function getErrors(): array
method getSchema (line 48) | public function getSchema(): Schema
FILE: src/Schema/Validation/ValidationContextInterface.php
type ValidationContextInterface (line 8) | interface ValidationContextInterface
method reportError (line 13) | public function reportError(ValidationExceptionInterface $error): void;
method getErrors (line 18) | public function getErrors(): array;
method getSchema (line 23) | public function getSchema(): Schema;
FILE: src/Schema/utils.php
function descriptionLines (line 10) | function descriptionLines(string $description, int $maxLength): array
function breakLine (line 28) | function breakLine(string $line, int $maxLength): array
function escapeQuotes (line 48) | function escapeQuotes(string $line): string
function printLines (line 57) | function printLines(array $lines): string
function printInputFields (line 71) | function printInputFields(array $fields): string
function printArray (line 81) | function printArray(string $glue, array $items): string
FILE: src/Type/Coercer/AbstractCoercer.php
class AbstractCoercer (line 5) | abstract class AbstractCoercer implements CoercerInterface
FILE: src/Type/Coercer/BooleanCoercer.php
class BooleanCoercer (line 7) | class BooleanCoercer extends AbstractCoercer
method coerce (line 12) | public function coerce($value): bool
FILE: src/Type/Coercer/CoercerInterface.php
type CoercerInterface (line 5) | interface CoercerInterface
method coerce (line 11) | public function coerce($value);
FILE: src/Type/Coercer/CoercingException.php
class CoercingException (line 7) | class CoercingException extends GraphQLException
FILE: src/Type/Coercer/FloatCoercer.php
class FloatCoercer (line 7) | class FloatCoercer extends AbstractCoercer
method coerce (line 12) | public function coerce($value): float
FILE: src/Type/Coercer/IntCoercer.php
class IntCoercer (line 7) | class IntCoercer extends AbstractCoercer
method coerce (line 14) | public function coerce($value): int
FILE: src/Type/Coercer/StringCoercer.php
class StringCoercer (line 7) | class StringCoercer extends AbstractCoercer
method coerce (line 12) | public function coerce($value): string
FILE: src/Type/CoercerProvider.php
class CoercerProvider (line 11) | class CoercerProvider extends AbstractServiceProvider
method register (line 26) | public function register()
FILE: src/Type/Definition/AbstractTypeInterface.php
type AbstractTypeInterface (line 5) | interface AbstractTypeInterface extends NamedTypeInterface
method resolveType (line 11) | public function resolveType(...$args);
method hasResolveTypeCallback (line 16) | public function hasResolveTypeCallback(): bool;
FILE: src/Type/Definition/Argument.php
class Argument (line 9) | class Argument implements InputValueInterface, ASTNodeAwareInterface, De...
method __construct (line 26) | public function __construct(
FILE: src/Type/Definition/ArgumentsAwareInterface.php
type ArgumentsAwareInterface (line 5) | interface ArgumentsAwareInterface
method hasArguments (line 10) | public function hasArguments(): bool;
method getArguments (line 15) | public function getArguments(): array;
FILE: src/Type/Definition/ArgumentsTrait.php
type ArgumentsTrait (line 9) | trait ArgumentsTrait
method getName (line 24) | public abstract function getName(): string;
method getRawArguments (line 29) | public function getRawArguments(): array
method hasArguments (line 37) | public function hasArguments(): bool
method getArguments (line 45) | public function getArguments(): array
method buildArguments (line 56) | protected function buildArguments(string $typeName, array $rawArgument...
FILE: src/Type/Definition/CompositeTypeInterface.php
type CompositeTypeInterface (line 8) | interface CompositeTypeInterface extends TypeInterface
FILE: src/Type/Definition/DefaultValue.php
class DefaultValue (line 7) | class DefaultValue
FILE: src/Type/Definition/DefaultValueTrait.php
type DefaultValueTrait (line 5) | trait DefaultValueTrait
method hasDefaultValue (line 15) | public function hasDefaultValue(): bool
method getDefaultValue (line 23) | public function getDefaultValue()
FILE: src/Type/Definition/DeprecationAwareInterface.php
type DeprecationAwareInterface (line 8) | interface DeprecationAwareInterface
method getDeprecationReason (line 13) | public function getDeprecationReason(): ?string;
method isDeprecated (line 18) | public function isDeprecated(): bool;
FILE: src/Type/Definition/DeprecationTrait.php
type DeprecationTrait (line 5) | trait DeprecationTrait
method getDeprecationReason (line 15) | public function getDeprecationReason(): ?string
method isDeprecated (line 23) | public function isDeprecated(): bool
FILE: src/Type/Definition/DescriptionAwareInterface.php
type DescriptionAwareInterface (line 5) | interface DescriptionAwareInterface
method getDescription (line 10) | public function getDescription(): ?string;
FILE: src/Type/Definition/DescriptionTrait.php
type DescriptionTrait (line 5) | trait DescriptionTrait
method hasDescription (line 15) | public function hasDescription(): bool
method getDescription (line 23) | public function getDescription(): ?string
FILE: src/Type/Definition/Directive.php
class Directive (line 11) | class Directive implements DefinitionInterface, ASTNodeAwareInterface, A...
method __construct (line 35) | public function __construct(
method getLocations (line 55) | public function getLocations(): array
FILE: src/Type/Definition/EnumType.php
class EnumType (line 36) | class EnumType implements NamedTypeInterface, InputTypeInterface, LeafTy...
method __construct (line 63) | public function __construct(string $name, ?string $description, array ...
method serialize (line 76) | public function serialize($value)
method parseValue (line 92) | public function parseValue($value)
method parseLiteral (line 110) | public function parseLiteral(NodeInterface $node)
method getValue (line 128) | public function getValue(string $name): ?EnumValue
method getValues (line 137) | public function getValues(): array
method getValueByName (line 150) | protected function getValueByName(string $name): ?EnumValue
method getValueByValue (line 166) | protected function getValueByValue($value): ?EnumValue
method buildValues (line 182) | protected function buildValues(array $rawValues): array
FILE: src/Type/Definition/EnumValue.php
class EnumValue (line 10) | class EnumValue implements DefinitionInterface, ASTNodeAwareInterface, D...
method __construct (line 28) | public function __construct(
FILE: src/Type/Definition/ExtensionASTNodesTrait.php
type ExtensionASTNodesTrait (line 8) | trait ExtensionASTNodesTrait
method hasExtensionAstNodes (line 18) | public function hasExtensionAstNodes(): bool
method getExtensionAstNodes (line 26) | public function getExtensionAstNodes(): array
FILE: src/Type/Definition/Field.php
class Field (line 10) | class Field implements FieldInterface, ASTNodeAwareInterface, ArgumentsA...
method __construct (line 40) | public function __construct(
method subscribe (line 67) | public function subscribe(...$args)
method hasSubscribeCallback (line 77) | public function hasSubscribeCallback()
method getSubscribeCallback (line 85) | public function getSubscribeCallback(): ?callable
FILE: src/Type/Definition/FieldInterface.php
type FieldInterface (line 7) | interface FieldInterface extends DefinitionInterface
FILE: src/Type/Definition/FieldsAwareInterface.php
type FieldsAwareInterface (line 8) | interface FieldsAwareInterface
method getName (line 13) | public function getName(): string;
method getAstNode (line 18) | public function getAstNode(): ?NodeInterface;
method getExtensionAstNodes (line 23) | public function getExtensionAstNodes(): array;
method getField (line 29) | public function getField(string $fieldName): ?Field;
method getFields (line 34) | public function getFields(): array;
FILE: src/Type/Definition/FieldsTrait.php
type FieldsTrait (line 11) | trait FieldsTrait
method getName (line 31) | abstract public function getName(): string;
method getField (line 38) | public function getField(string $fieldName): ?Field
method getFields (line 47) | public function getFields(): array
method buildFieldMap (line 62) | protected function buildFieldMap($rawFieldsOrThunk): array
FILE: src/Type/Definition/InputField.php
class InputField (line 9) | class InputField implements InputValueInterface, FieldInterface, ASTNode...
method __construct (line 26) | public function __construct(
FILE: src/Type/Definition/InputObjectType.php
class InputObjectType (line 32) | class InputObjectType implements NamedTypeInterface, InputTypeInterface,...
method __construct (line 62) | public function __construct(
method getField (line 79) | public function getField(string $fieldName): ?InputField
method getFields (line 88) | public function getFields(): array
method buildFieldMap (line 102) | protected function buildFieldMap($rawFieldsOrThunk): array
FILE: src/Type/Definition/InputTypeInterface.php
type InputTypeInterface (line 8) | interface InputTypeInterface extends TypeInterface
FILE: src/Type/Definition/InputValueInterface.php
type InputValueInterface (line 7) | interface InputValueInterface extends DefinitionInterface
method getName (line 12) | public function getName(): string;
method getType (line 17) | public function getType(): ?TypeInterface;
method hasDefaultValue (line 22) | public function hasDefaultValue(): bool;
method getDefaultValue (line 27) | public function getDefaultValue();
FILE: src/Type/Definition/InterfaceType.php
class InterfaceType (line 26) | class InterfaceType implements AbstractTypeInterface, CompositeTypeInter...
method __construct (line 46) | public function __construct(
FILE: src/Type/Definition/LeafTypeInterface.php
type LeafTypeInterface (line 8) | interface LeafTypeInterface extends TypeInterface
FILE: src/Type/Definition/ListType.php
class ListType (line 5) | class ListType implements TypeInterface, WrappingTypeInterface
method __construct (line 14) | public function __construct(TypeInterface $ofType)
method __toString (line 22) | public function __toString(): string
FILE: src/Type/Definition/NameTrait.php
type NameTrait (line 5) | trait NameTrait
method getName (line 15) | public function getName(): string
method __toString (line 23) | public function __toString(): string
FILE: src/Type/Definition/NamedTypeInterface.php
type NamedTypeInterface (line 8) | interface NamedTypeInterface extends TypeInterface
method getName (line 13) | public function getName(): string;
FILE: src/Type/Definition/NonNullType.php
class NonNullType (line 5) | class NonNullType implements TypeInterface, WrappingTypeInterface
method __construct (line 14) | public function __construct(TypeInterface $ofType)
method __toString (line 22) | public function __toString(): string
FILE: src/Type/Definition/ObjectType.php
class ObjectType (line 52) | class ObjectType implements NamedTypeInterface, CompositeTypeInterface, ...
method __construct (line 93) | public function __construct(
method isTypeOf (line 117) | public function isTypeOf($value, $context, $info)
method hasInterfaces (line 128) | public function hasInterfaces(): bool
method getInterfaces (line 137) | public function getInterfaces(): array
method hasIsTypeOfCallback (line 148) | public function hasIsTypeOfCallback(): bool
method getIsTypeOfCallback (line 156) | public function getIsTypeOfCallback(): ?callable
method buildInterfaces (line 166) | protected function buildInterfaces($interfacesOrThunk): array
FILE: src/Type/Definition/OfTypeTrait.php
type OfTypeTrait (line 5) | trait OfTypeTrait
method getOfType (line 15) | public function getOfType(): TypeInterface
FILE: src/Type/Definition/OutputTypeInterface.php
type OutputTypeInterface (line 8) | interface OutputTypeInterface extends TypeInterface
FILE: src/Type/Definition/ResolveTrait.php
type ResolveTrait (line 5) | trait ResolveTrait
method resolve (line 16) | public function resolve(...$args)
method hasResolveCallback (line 26) | public function hasResolveCallback()
method getResolveCallback (line 34) | public function getResolveCallback(): ?callable
FILE: src/Type/Definition/ResolveTypeTrait.php
type ResolveTypeTrait (line 5) | trait ResolveTypeTrait
method resolveType (line 17) | public function resolveType(...$args)
method hasResolveTypeCallback (line 27) | public function hasResolveTypeCallback(): bool
method getResolveTypeCallback (line 35) | public function getResolveTypeCallback(): ?callable
FILE: src/Type/Definition/ScalarType.php
class ScalarType (line 11) | class ScalarType implements NamedTypeInterface, LeafTypeInterface, Input...
method __construct (line 44) | public function __construct(
method serialize (line 64) | public function serialize($value)
method parseValue (line 73) | public function parseValue($value)
method parseLiteral (line 85) | public function parseLiteral(NodeInterface $node, ?array $variables = ...
method isValidValue (line 96) | public function isValidValue($value): bool
method isValidLiteral (line 105) | public function isValidLiteral(NodeInterface $node): bool
FILE: src/Type/Definition/SerializableTypeInterface.php
type SerializableTypeInterface (line 10) | interface SerializableTypeInterface extends TypeInterface
method serialize (line 16) | public function serialize($value);
method parseValue (line 22) | public function parseValue($value);
method parseLiteral (line 28) | public function parseLiteral(NodeInterface $node);
FILE: src/Type/Definition/SpecifiedDirectiveEnum.php
class SpecifiedDirectiveEnum (line 5) | class SpecifiedDirectiveEnum
method values (line 15) | public static function values(): array
FILE: src/Type/Definition/TypeInterface.php
type TypeInterface (line 10) | interface TypeInterface extends DefinitionInterface
FILE: src/Type/Definition/TypeNameEnum.php
class TypeNameEnum (line 5) | class TypeNameEnum
method values (line 22) | public static function values(): array
FILE: src/Type/Definition/TypeTrait.php
type TypeTrait (line 5) | trait TypeTrait
method getType (line 15) | public function getType(): ?TypeInterface
FILE: src/Type/Definition/UnionType.php
class UnionType (line 33) | class UnionType implements AbstractTypeInterface, CompositeTypeInterface...
method __construct (line 65) | public function __construct(
method getTypes (line 83) | public function getTypes(): array
method buildTypeMap (line 98) | protected function buildTypeMap($typesOrThunk): array
FILE: src/Type/Definition/ValueTrait.php
type ValueTrait (line 5) | trait ValueTrait
method getValue (line 15) | public function getValue()
FILE: src/Type/Definition/WrappingTypeInterface.php
type WrappingTypeInterface (line 8) | interface WrappingTypeInterface extends TypeInterface
method getOfType (line 13) | public function getOfType(): TypeInterface;
FILE: src/Type/DirectivesProvider.php
class DirectivesProvider (line 9) | class DirectivesProvider extends AbstractServiceProvider
method register (line 23) | public function register()
FILE: src/Type/IntrospectionProvider.php
class IntrospectionProvider (line 25) | class IntrospectionProvider extends AbstractServiceProvider
method register (line 49) | public function register()
method registerIntrospectionTypes (line 58) | protected function registerIntrospectionTypes()
method registerMetaFields (line 457) | protected function registerMetaFields()
FILE: src/Type/ScalarTypesProvider.php
class ScalarTypesProvider (line 18) | class ScalarTypesProvider extends AbstractServiceProvider
method register (line 34) | public function register()
FILE: src/Type/TypeKindEnum.php
class TypeKindEnum (line 5) | class TypeKindEnum
method values (line 21) | public static function values(): array
FILE: src/Type/definition.php
function resolveThunk (line 32) | function resolveThunk($maybeThunk)
function isAssocArray (line 41) | function isAssocArray($value): bool
function assertType (line 57) | function assertType($type)
function isInputType (line 72) | function isInputType(?TypeInterface $type): bool
function isOutputType (line 86) | function isOutputType(?TypeInterface $type): bool
function getNullableType (line 97) | function getNullableType(?TypeInterface $type): ?TypeInterface
function getNamedType (line 110) | function getNamedType(?TypeInterface $type): ?TypeInterface
function newScalarType (line 132) | function newScalarType(array $config = []): ScalarType
function newEnumType (line 171) | function newEnumType(array $config = []): EnumType
function newEnumValue (line 190) | function newEnumValue(array $config = []): EnumValue
function newInputObjectType (line 210) | function newInputObjectType(array $config = []): InputObjectType
function newInputField (line 229) | function newInputField(array $config = []): InputField
function newInterfaceType (line 249) | function newInterfaceType(array $config = []): InterfaceType
function newObjectType (line 275) | function newObjectType(array $config = []): ObjectType
function newField (line 304) | function newField(array $config = []): Field
function newArgument (line 328) | function newArgument(array $config = []): Argument
function newUnionType (line 348) | function newUnionType(array $config = []): UnionType
function newSchema (line 375) | function newSchema(array $config = []): Schema
function newDirective (line 412) | function newDirective(array $config = []): Directive
function newList (line 438) | function newList($ofType): ListType
function newNonNull (line 452) | function newNonNull($ofType): NonNullType
FILE: src/Type/directives.php
function IncludeDirective (line 10) | function IncludeDirective(): Directive
function SkipDirective (line 18) | function SkipDirective(): Directive
function DeprecatedDirective (line 28) | function DeprecatedDirective(): Directive
function specifiedDirectives (line 36) | function specifiedDirectives(): array
function isSpecifiedDirective (line 49) | function isSpecifiedDirective(Directive $directive): bool
FILE: src/Type/introspection.php
function __Schema (line 15) | function __Schema(): ObjectType
function __Directive (line 23) | function __Directive(): ObjectType
function __DirectiveLocation (line 32) | function __DirectiveLocation(): EnumType
function __Type (line 41) | function __Type(): ObjectType
function __Field (line 49) | function __Field(): ObjectType
function __InputValue (line 57) | function __InputValue(): ObjectType
function __EnumValue (line 65) | function __EnumValue(): ObjectType
function __TypeKind (line 73) | function __TypeKind(): EnumType
function SchemaMetaFieldDefinition (line 81) | function SchemaMetaFieldDefinition(): Field
function TypeMetaFieldDefinition (line 89) | function TypeMetaFieldDefinition(): Field
function TypeNameMetaFieldDefinition (line 97) | function TypeNameMetaFieldDefinition(): Field
function introspectionTypes (line 105) | function introspectionTypes(): array
function isIntrospectionType (line 123) | function isIntrospectionType(NamedTypeInterface $type): bool
FILE: src/Type/scalars.php
function booleanType (line 13) | function booleanType(): ScalarType
function floatType (line 21) | function floatType(): ScalarType
function intType (line 29) | function intType(): ScalarType
function idType (line 37) | function idType(): ScalarType
function stringType (line 45) | function stringType(): ScalarType
function specifiedScalarTypes (line 53) | function specifiedScalarTypes(): array
function isSpecifiedScalarType (line 68) | function isSpecifiedScalarType(NamedTypeInterface $type): bool
FILE: src/Util/AbstractEnum.php
class AbstractEnum (line 5) | abstract class AbstractEnum
method values (line 11) | public static function values(): array
FILE: src/Util/ArrayToJsonTrait.php
type ArrayToJsonTrait (line 5) | trait ArrayToJsonTrait
method toArray (line 10) | abstract public function toArray(): array;
method toJSON (line 15) | public function toJSON(): string
FILE: src/Util/ConversionException.php
class ConversionException (line 7) | class ConversionException extends AbstractException
FILE: src/Util/NameHelper.php
class NameHelper (line 8) | class NameHelper
method isValidError (line 18) | public static function isValidError(string $name, $node = null): ?Vali...
FILE: src/Util/NodeComparator.php
class NodeComparator (line 7) | class NodeComparator
method compare (line 14) | public static function compare(NodeInterface $node, NodeInterface $oth...
FILE: src/Util/SerializationInterface.php
type SerializationInterface (line 5) | interface SerializationInterface
method toArray (line 11) | public function toArray(): array;
method toJSON (line 16) | public function toJSON(): string;
FILE: src/Util/TypeASTConverter.php
class TypeASTConverter (line 16) | class TypeASTConverter
method convert (line 31) | public static function convert(Schema $schema, TypeNodeInterface $type...
FILE: src/Util/TypeHelper.php
class TypeHelper (line 15) | class TypeHelper
method isEqualType (line 24) | public static function isEqualType(TypeInterface $typeA, TypeInterface...
method isTypeSubtypeOf (line 56) | public static function isTypeSubtypeOf(
method doTypesOverlap (line 118) | public static function doTypesOverlap(Schema $schema, TypeInterface $t...
method compareTypes (line 159) | public static function compareTypes(TypeInterface $typeA, TypeInterfac...
FILE: src/Util/TypeInfo.php
class TypeInfo (line 22) | class TypeInfo
method __construct (line 80) | public function __construct(
method resolveFieldDefinition (line 109) | public function resolveFieldDefinition(
method pushType (line 120) | public function pushType(?TypeInterface $type): void
method popType (line 128) | public function popType(): void
method getType (line 136) | public function getType(): ?TypeInterface
method pushParentType (line 144) | public function pushParentType(?CompositeTypeInterface $type): void
method popParentType (line 152) | public function popParentType(): void
method getParentType (line 160) | public function getParentType(): ?CompositeTypeInterface
method pushInputType (line 168) | public function pushInputType(?TypeInterface $type): void
method popInputType (line 176) | public function popInputType(): void
method getInputType (line 184) | public function getInputType(): ?TypeInterface
method getParentInputType (line 192) | public function getParentInputType(): ?TypeInterface
method pushFieldDefinition (line 200) | public function pushFieldDefinition(?Field $fieldDefinition): void
method popFieldDefinition (line 208) | public function popFieldDefinition(): void
method getFieldDefinition (line 216) | public function getFieldDefinition(): ?Field
method getSchema (line 224) | public function getSchema(): Schema
method pushDefaultValue (line 232) | public function pushDefaultValue($defaultValue): void
method popDefaultValue (line 240) | public function popDefaultValue(): void
method getDefaultValue (line 248) | public function getDefaultValue()
method getDirective (line 256) | public function getDirective(): ?Directive
method setDirective (line 264) | public function setDirective(?Directive $directive): void
method getArgument (line 272) | public function getArgument(): ?Argument
method setArgument (line 280) | public function setArgument(?Argument $argument): void
method getEnumValue (line 288) | public function getEnumValue(): ?EnumValue
method setEnumValue (line 296) | public function setEnumValue(?EnumValue $enumValue): void
method getFromStack (line 306) | protected function getFromStack(array $stack, int $depth)
function getFieldDefinition (line 321) | function getFieldDefinition(Schema $schema, TypeInterface $parentType, F...
FILE: src/Util/ValueASTConverter.php
class ValueASTConverter (line 22) | class ValueASTConverter
method convert (line 51) | public static function convert(NodeInterface $node, TypeInterface $typ...
method convertNonNullType (line 93) | protected static function convertNonNullType(NodeInterface $node, NonN...
method convertVariable (line 109) | protected static function convertVariable(VariableNode $node, TypeInte...
method convertListType (line 142) | protected static function convertListType(NodeInterface $node, ListTyp...
method convertInputObjectType (line 178) | protected static function convertInputObjectType(
method convertEnumType (line 222) | protected static function convertEnumType(NodeInterface $node, EnumTyp...
method convertScalarType (line 246) | protected static function convertScalarType(NodeInterface $node, Scala...
method isMissingVariable (line 269) | protected static function isMissingVariable(ValueNodeInterface $node, ...
FILE: src/Util/ValueConverter.php
class ValueConverter (line 30) | class ValueConverter
method convert (line 55) | public static function convert($value, TypeInterface $type): ?ValueNod...
method convertListType (line 94) | protected static function convertListType($value, ListType $type): ?Va...
method convertInputObjectType (line 122) | protected static function convertInputObjectType($value, InputObjectTy...
method convertScalarOrEnum (line 151) | protected static function convertScalarOrEnum($value, SerializableType...
FILE: src/Util/ValueHelper.php
class ValueHelper (line 8) | class ValueHelper
method compareArguments (line 15) | public static function compareArguments(array $argumentsA, array $argu...
FILE: src/Util/utils.php
function invariant (line 16) | function invariant(bool $condition, string $message)
function orList (line 29) | function orList(array $items): string
function suggestionList (line 55) | function suggestionList(string $input, array $options): array
function quotedOrList (line 86) | function quotedOrList(array $items): string
function arrayEvery (line 99) | function arrayEvery(array $array, callable $fn): bool
function arraySome (line 111) | function arraySome(array $array, callable $fn)
function find (line 123) | function find(array $array, callable $predicate)
function keyMap (line 139) | function keyMap(array $array, callable $keyFn): array
function keyValueMap (line 153) | function keyValueMap(array $array, callable $keyFn, callable $valFn): array
function promiseForMap (line 165) | function promiseForMap(array $map): PromiseInterface
function promiseReduce (line 187) | function promiseReduce(array $values, callable $fn, $initial = null)
function toString (line 202) | function toString($value): string
FILE: src/Validation/Conflict/ComparisonContext.php
class ComparisonContext (line 11) | class ComparisonContext
method registerField (line 32) | public function registerField(FieldContext $field)
method registerFragment (line 49) | public function registerFragment(NodeInterface $fragment)
method reportConflict (line 62) | public function reportConflict(Conflict $conflict)
method getFieldMap (line 72) | public function getFieldMap(): array
method getFragmentNames (line 80) | public function getFragmentNames(): array
method hasConflicts (line 88) | public function hasConflicts(): bool
method getConflicts (line 96) | public function getConflicts(): array
FILE: src/Validation/Conflict/Conflict.php
class Conflict (line 5) | class Conflict
method __construct (line 34) | public function __construct(string $responseName, $reason, array $fiel...
method getResponseName (line 45) | public function getResponseName(): string
method getReason (line 53) | public function getReason()
method getFieldsA (line 61) | public function getFieldsA(): array
method getFieldsB (line 69) | public function getFieldsB(): array
method getAllFields (line 77) | public function getAllFields(): array
FILE: src/Validation/Conflict/ConflictFinder.php
class ConflictFinder (line 78) | class ConflictFinder
method __construct (line 103) | public function __construct()
method findConflictsWithinSelectionSet (line 117) | public function findConflictsWithinSelectionSet(
method collectConflictsBetweenFieldsAndFragment (line 177) | protected function collectConflictsBetweenFieldsAndFragment(
method collectConflictsBetweenFragments (line 247) | protected function collectConflictsBetweenFragments(
method findConflictsBetweenSubSelectionSets (line 336) | protected function findConflictsBetweenSubSelectionSets(
method collectConflictsWithin (line 423) | protected function collectConflictsWithin(ComparisonContext $context):...
method collectConflictsBetween (line 471) | protected function collectConflictsBetween(
method findConflict (line 521) | protected function findConflict(
method getFieldsAndFragmentNames (line 620) | protected function getFieldsAndFragmentNames(
method getReferencedFieldsAndFragmentNames (line 645) | protected function getReferencedFieldsAndFragmentNames(FragmentDefinit...
method collectFieldsAndFragmentNames (line 665) | protected function collectFieldsAndFragmentNames(
method subfieldConflicts (line 701) | protected function subfieldConflicts(
FILE: src/Validation/Conflict/FieldContext.php
class FieldContext (line 10) | class FieldContext
method __construct (line 33) | public function __construct(
method getParentType (line 46) | public function getParentType(): ?NamedTypeInterface
method getNode (line 54) | public function getNode(): FieldNode
method getDefinition (line 62) | public function getDefinition(): ?Field
FILE: src/Validation/Conflict/PairSet.php
class PairSet (line 9) | class PairSet
method has (line 22) | public function has(string $a, string $b, bool $areMutuallyExclusive):...
method add (line 46) | public function add(string $a, string $b, bool $areMutuallyExclusive):...
method addToData (line 57) | protected function addToData(string $a, string $b, bool $areMutuallyEx...
FILE: src/Validation/Rule/AbstractRule.php
class AbstractRule (line 8) | abstract class AbstractRule extends SpecificKindVisitor implements RuleI...
FILE: src/Validation/Rule/ExecutableDefinitionsRule.php
class ExecutableDefinitionsRule (line 21) | class ExecutableDefinitionsRule extends AbstractRule
method enterDocument (line 26) | protected function enterDocument(DocumentNode $node): VisitorResult
method getDefinitionName (line 46) | protected function getDefinitionName(NodeInterface $node): ?string
FILE: src/Validation/Rule/FieldOnCorrectTypeRule.php
class FieldOnCorrectTypeRule (line 26) | class FieldOnCorrectTypeRule extends AbstractRule
method enterField (line 31) | protected function enterField(FieldNode $node): VisitorResult
method getSuggestedTypeNames (line 75) | protected function getSuggestedTypeNames(Schema $schema, TypeInterface...
method getSuggestedFieldNames (line 136) | protected function getSuggestedFieldNames(OutputTypeInterface $type, s...
FILE: src/Validation/Rule/FragmentsOnCompositeTypesRule.php
class FragmentsOnCompositeTypesRule (line 22) | class FragmentsOnCompositeTypesRule extends AbstractRule
method enterFragmentDefinition (line 27) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
method enterInlineFragment (line 39) | protected function enterInlineFragment(InlineFragmentNode $node): Visi...
method validateFragementNode (line 55) | protected function validateFragementNode($node, callable $errorMessage...
FILE: src/Validation/Rule/KnownArgumentNamesRule.php
class KnownArgumentNamesRule (line 23) | class KnownArgumentNamesRule extends AbstractRule
method enterArgument (line 28) | protected function enterArgument(ArgumentNode $node): VisitorResult
method validateField (line 51) | protected function validateField(NodeInterface $node): ?NodeInterface
method validateDirective (line 84) | protected function validateDirective(NodeInterface $node): ?NodeInterface
FILE: src/Validation/Rule/KnownDirectivesRule.php
class KnownDirectivesRule (line 43) | class KnownDirectivesRule extends AbstractRule
method enterDirective (line 48) | protected function enterDirective(DirectiveNode $node): VisitorResult
method getDirectiveLocationFromASTPath (line 81) | protected function getDirectiveLocationFromASTPath(NodeInterface $node...
FILE: src/Validation/Rule/KnownFragmentNamesRule.php
class KnownFragmentNamesRule (line 16) | class KnownFragmentNamesRule extends AbstractRule
method enterFragmentSpread (line 21) | public function enterFragmentSpread(FragmentSpreadNode $node): Visitor...
FILE: src/Validation/Rule/KnownTypeNamesRule.php
class KnownTypeNamesRule (line 21) | class KnownTypeNamesRule extends AbstractRule
method enterNamedType (line 26) | protected function enterNamedType(NamedTypeNode $node): VisitorResult
method enterObjectTypeDefinition (line 49) | protected function enterObjectTypeDefinition(ObjectTypeDefinitionNode ...
method enterInterfaceTypeDefinition (line 57) | protected function enterInterfaceTypeDefinition(InterfaceTypeDefinitio...
method enterUnionTypeDefinition (line 65) | protected function enterUnionTypeDefinition(UnionTypeDefinitionNode $n...
method enterInputObjectTypeDefinition (line 73) | protected function enterInputObjectTypeDefinition(InputObjectTypeDefin...
FILE: src/Validation/Rule/LoneAnonymousOperationRule.php
class LoneAnonymousOperationRule (line 17) | class LoneAnonymousOperationRule extends AbstractRule
method enterDocument (line 27) | protected function enterDocument(DocumentNode $node): VisitorResult
method enterOperationDefinition (line 39) | protected function enterOperationDefinition(OperationDefinitionNode $n...
FILE: src/Validation/Rule/NoFragmentCyclesRule.php
class NoFragmentCyclesRule (line 18) | class NoFragmentCyclesRule extends AbstractRule
method enterOperationDefinition (line 45) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterFragmentDefinition (line 53) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
method detectFragmentCycle (line 69) | protected function detectFragmentCycle(FragmentDefinitionNode $fragmen...
FILE: src/Validation/Rule/NoUndefinedVariablesRule.php
class NoUndefinedVariablesRule (line 18) | class NoUndefinedVariablesRule extends AbstractRule
method enterOperationDefinition (line 28) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterVariableDefinition (line 38) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
method leaveOperationDefinition (line 48) | protected function leaveOperationDefinition(OperationDefinitionNode $n...
FILE: src/Validation/Rule/NoUnusedFragmentsRule.php
class NoUnusedFragmentsRule (line 18) | class NoUnusedFragmentsRule extends AbstractRule
method enterOperationDefinition (line 33) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterFragmentDefinition (line 43) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
method leaveDocument (line 53) | protected function leaveDocument(DocumentNode $node): VisitorResult
FILE: src/Validation/Rule/NoUnusedVariablesRule.php
class NoUnusedVariablesRule (line 18) | class NoUnusedVariablesRule extends AbstractRule
method enterOperationDefinition (line 28) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterVariableDefinition (line 38) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
method leaveOperationDefinition (line 48) | protected function leaveOperationDefinition(OperationDefinitionNode $n...
FILE: src/Validation/Rule/OverlappingFieldsCanBeMergedRule.php
class OverlappingFieldsCanBeMergedRule (line 18) | class OverlappingFieldsCanBeMergedRule extends AbstractRule
method __construct (line 28) | public function __construct()
method enterSelectionSet (line 36) | protected function enterSelectionSet(SelectionSetNode $node): VisitorR...
FILE: src/Validation/Rule/PossibleFragmentSpreadsRule.php
class PossibleFragmentSpreadsRule (line 25) | class PossibleFragmentSpreadsRule extends AbstractRule
method enterInlineFragment (line 32) | protected function enterInlineFragment(InlineFragmentNode $node): Visi...
method enterFragmentSpread (line 58) | protected function enterFragmentSpread(FragmentSpreadNode $node): Visi...
method getFragmentType (line 85) | protected function getFragmentType(string $name): ?TypeInterface
FILE: src/Validation/Rule/ProvidedRequiredArgumentsRule.php
class ProvidedRequiredArgumentsRule (line 21) | class ProvidedRequiredArgumentsRule extends AbstractRule
method leaveField (line 28) | protected function leaveField(FieldNode $node): VisitorResult
method leaveDirective (line 70) | protected function leaveDirective(DirectiveNode $node): VisitorResult
FILE: src/Validation/Rule/RuleInterface.php
type RuleInterface (line 7) | interface RuleInterface
method setContext (line 13) | public function setContext(ValidationContextInterface $context);
FILE: src/Validation/Rule/ScalarLeafsRule.php
class ScalarLeafsRule (line 19) | class ScalarLeafsRule extends AbstractRule
method enterField (line 24) | protected function enterField(FieldNode $node): VisitorResult
FILE: src/Validation/Rule/SingleFieldSubscriptionsRule.php
class SingleFieldSubscriptionsRule (line 15) | class SingleFieldSubscriptionsRule extends AbstractRule
method enterOperationDefinition (line 20) | protected function enterOperationDefinition(OperationDefinitionNode $n...
FILE: src/Validation/Rule/SupportedRules.php
class SupportedRules (line 7) | class SupportedRules
method build (line 45) | public static function build(): array
FILE: src/Validation/Rule/UniqueArgumentNamesRule.php
class UniqueArgumentNamesRule (line 19) | class UniqueArgumentNamesRule extends AbstractRule
method enterField (line 29) | protected function enterField(FieldNode $node): VisitorResult
method enterDirective (line 39) | protected function enterDirective(DirectiveNode $node): VisitorResult
method enterArgument (line 49) | protected function enterArgument(ArgumentNode $node): VisitorResult
FILE: src/Validation/Rule/UniqueDirectivesPerLocationRule.php
class UniqueDirectivesPerLocationRule (line 17) | class UniqueDirectivesPerLocationRule extends AbstractRule
method enterNode (line 22) | public function enterNode(NodeInterface $node): VisitorResult
FILE: src/Validation/Rule/UniqueFragmentNamesRule.php
class UniqueFragmentNamesRule (line 17) | class UniqueFragmentNamesRule extends AbstractRule
method enterOperationDefinition (line 27) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterFragmentDefinition (line 35) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
FILE: src/Validation/Rule/UniqueInputFieldNamesRule.php
class UniqueInputFieldNamesRule (line 18) | class UniqueInputFieldNamesRule extends AbstractRule
method enterObjectValue (line 33) | protected function enterObjectValue(ObjectValueNode $node): VisitorResult
method enterObjectField (line 44) | protected function enterObjectField(ObjectFieldNode $node): VisitorResult
method leaveObjectValue (line 65) | protected function leaveObjectValue(ObjectValueNode $node): VisitorResult
FILE: src/Validation/Rule/UniqueOperationNamesRule.php
class UniqueOperationNamesRule (line 16) | class UniqueOperationNamesRule extends AbstractRule
method enterOperationDefinition (line 26) | protected function enterOperationDefinition(OperationDefinitionNode $n...
FILE: src/Validation/Rule/UniqueVariableNamesRule.php
class UniqueVariableNamesRule (line 17) | class UniqueVariableNamesRule extends AbstractRule
method enterOperationDefinition (line 27) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method enterVariableDefinition (line 37) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
FILE: src/Validation/Rule/ValuesOfCorrectTypeRule.php
class ValuesOfCorrectTypeRule (line 41) | class ValuesOfCorrectTypeRule extends AbstractRule
method enterNullValue (line 46) | protected function enterNullValue(NullValueNode $node): VisitorResult
method enterListValue (line 65) | protected function enterListValue(ListValueNode $node): VisitorResult
method enterObjectField (line 83) | protected function enterObjectField(ObjectFieldNode $node): VisitorResult
method enterObjectValue (line 106) | protected function enterObjectValue(ObjectValueNode $node): VisitorResult
method enterEnumValue (line 146) | protected function enterEnumValue(EnumValueNode $node): VisitorResult
method enterIntValue (line 169) | protected function enterIntValue(IntValueNode $node): VisitorResult
method enterFloatValue (line 179) | protected function enterFloatValue(FloatValueNode $node): VisitorResult
method enterStringValue (line 189) | protected function enterStringValue(StringValueNode $node): VisitorResult
method enterBooleanValue (line 199) | protected function enterBooleanValue(BooleanValueNode $node): VisitorR...
method isValidScalar (line 213) | protected function isValidScalar(ValueNodeInterface $node): void
method getEnumTypeSuggestion (line 271) | protected function getEnumTypeSuggestion(NamedTypeInterface $type, Val...
FILE: src/Validation/Rule/VariablesAreInputTypesRule.php
class VariablesAreInputTypesRule (line 21) | class VariablesAreInputTypesRule extends AbstractRule
method enterVariableDefinition (line 29) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
FILE: src/Validation/Rule/VariablesDefaultValueAllowedRule.php
class VariablesDefaultValueAllowedRule (line 19) | class VariablesDefaultValueAllowedRule extends AbstractRule
method enterSelectionSet (line 24) | protected function enterSelectionSet(SelectionSetNode $node): VisitorR...
method enterFragmentDefinition (line 32) | protected function enterFragmentDefinition(FragmentDefinitionNode $nod...
method enterVariableDefinition (line 40) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
FILE: src/Validation/Rule/VariablesInAllowedPositionRule.php
class VariablesInAllowedPositionRule (line 23) | class VariablesInAllowedPositionRule extends AbstractRule
method enterOperationDefinition (line 33) | protected function enterOperationDefinition(OperationDefinitionNode $n...
method leaveOperationDefinition (line 46) | protected function leaveOperationDefinition(OperationDefinitionNode $n...
method enterVariableDefinition (line 90) | protected function enterVariableDefinition(VariableDefinitionNode $nod...
method getEffectiveType (line 106) | protected function getEffectiveType(
FILE: src/Validation/RulesProvider.php
class RulesProvider (line 34) | class RulesProvider extends AbstractServiceProvider
method register (line 70) | public function register()
FILE: src/Validation/ValidationContext.php
class ValidationContext (line 25) | class ValidationContext implements ValidationContextInterface
method __construct (line 78) | public function __construct(Schema $schema, DocumentNode $document, Ty...
method reportError (line 88) | public function reportError(ValidationException $error): void
method getErrors (line 96) | public function getErrors(): array
method getType (line 104) | public function getType(): ?TypeInterface
method getParentType (line 112) | public function getParentType(): ?TypeInterface
method getInputType (line 120) | public function getInputType(): ?TypeInterface
method getParentInputType (line 128) | public function getParentInputType(): ?TypeInterface
method getFieldDefinition (line 136) | public function getFieldDefinition(): ?Field
method getSchema (line 144) | public function getSchema(): Schema
method getArgument (line 152) | public function getArgument(): ?Argument
method getDirective (line 160) | public function getDirective(): ?Directive
method getFragment (line 168) | public function getFragment(string $name): ?FragmentDefinitionNode
method getFragmentSpreads (line 185) | public function getFragmentSpreads(SelectionSetNode $selectionSet): array
method getRecursiveVariableUsages (line 216) | public function getRecursiveVariableUsages(OperationDefinitionNode $op...
method getVariableUsages (line 239) | public function getVariableUsages(NodeInterface $node): array
method getRecursivelyReferencedFragments (line 276) | public function getRecursivelyReferencedFragments(OperationDefinitionN...
FILE: src/Validation/ValidationContextAwareTrait.php
type ValidationContextAwareTrait (line 5) | trait ValidationContextAwareTrait
method getContext (line 15) | public function getContext(): ValidationContextInterface
method setContext (line 24) | public function setContext(ValidationContextInterface $context)
FILE: src/Validation/ValidationContextInterface.php
type ValidationContextInterface (line 16) | interface ValidationContextInterface
method reportError (line 21) | public function reportError(ValidationException $error): void;
method getErrors (line 26) | public function getErrors(): array;
method getType (line 31) | public function getType(): ?TypeInterface;
method getParentType (line 36) | public function getParentType(): ?TypeInterface;
method getInputType (line 41) | public function getInputType(): ?TypeInterface;
method getParentInputType (line 46) | public function getParentInputType(): ?TypeInterface;
method getFieldDefinition (line 51) | public function getFieldDefinition(): ?Field;
method getSchema (line 56) | public function getSchema(): Schema;
method getArgument (line 61) | public function getArgument(): ?Argument;
method getDirective (line 66) | public function getDirective(): ?Directive;
method getFragment (line 72) | public function getFragment(string $name): ?FragmentDefinitionNode;
method getFragmentSpreads (line 78) | public function getFragmentSpreads(SelectionSetNode $selectionSet): ar...
method getRecursiveVariableUsages (line 84) | public function getRecursiveVariableUsages(OperationDefinitionNode $op...
method getVariableUsages (line 90) | public function getVariableUsages(NodeInterface $node): array;
method getRecursivelyReferencedFragments (line 96) | public function getRecursivelyReferencedFragments(OperationDefinitionN...
FILE: src/Validation/ValidationException.php
class ValidationException (line 7) | class ValidationException extends GraphQLException implements Validation...
FILE: src/Validation/ValidationExceptionInterface.php
type ValidationExceptionInterface (line 5) | interface ValidationExceptionInterface
FILE: src/Validation/ValidationProvider.php
class ValidationProvider (line 7) | class ValidationProvider extends AbstractServiceProvider
method register (line 19) | public function register()
FILE: src/Validation/Validator.php
class Validator (line 14) | class Validator implements ValidatorInterface
method validate (line 19) | public function validate(
method createContext (line 49) | public function createContext(
FILE: src/Validation/ValidatorInterface.php
type ValidatorInterface (line 9) | interface ValidatorInterface
method validate (line 18) | public function validate(
method createContext (line 31) | public function createContext(
FILE: src/Validation/messages.php
function nonExecutableDefinitionMessage (line 11) | function nonExecutableDefinitionMessage(string $definitionName): string
function undefinedFieldMessage (line 23) | function undefinedFieldMessage(
function inlineFragmentOnNonCompositeMessage (line 46) | function inlineFragmentOnNonCompositeMessage(string $typeName): string
function fragmentOnNonCompositeMessage (line 56) | function fragmentOnNonCompositeMessage(string $fragmentName, string $typ...
function unknownArgumentMessage (line 68) | function unknownArgumentMessage(
function unknownDirectiveArgumentMessage (line 87) | function unknownDirectiveArgumentMessage(string $argumentName, string $d...
function unknownDirectiveMessage (line 100) | function unknownDirectiveMessage(string $directiveName): string
function misplacedDirectiveMessage (line 110) | function misplacedDirectiveMessage(string $directiveName, string $locati...
function unknownFragmentMessage (line 119) | function unknownFragmentMessage(string $fragmentName): string
function unknownTypeMessage (line 129) | function unknownTypeMessage(string $typeName, array $suggestedTypes): st...
function anonymousOperationNotAloneMessage (line 141) | function anonymousOperationNotAloneMessage(): string
function fragmentCycleMessage (line 151) | function fragmentCycleMessage(string $fragmentName, array $spreadNames):...
function undefinedVariableMessage (line 162) | function undefinedVariableMessage(string $variableName, ?string $operati...
function unusedFragmentMessage (line 174) | function unusedFragmentMessage(string $fragmentName): string
function unusedVariableMessage (line 184) | function unusedVariableMessage(string $variableName, ?string $operationN...
function fieldsConflictMessage (line 197) | function fieldsConflictMessage(string $responseName, $reason): string
function conflictReasonMessage (line 210) | function conflictReasonMessage($reason): string
function typeIncompatibleSpreadMessage (line 232) | function typeIncompatibleSpreadMessage(
function typeIncompatibleAnonymousSpreadMessage (line 250) | function typeIncompatibleAnonymousSpreadMessage(string $parentType, stri...
function missingFieldArgumentMessage (line 265) | function missingFieldArgumentMessage(string $fieldName, string $argument...
function missingDirectiveArgumentMessage (line 281) | function missingDirectiveArgumentMessage(string $directiveName, string $...
function noSubselectionAllowedMessage (line 296) | function noSubselectionAllowedMessage(string $fieldName, string $typeNam...
function requiresSubselectionMessage (line 306) | function requiresSubselectionMessage(string $fieldName, string $typeName...
function singleFieldOnlyMessage (line 320) | function singleFieldOnlyMessage(?string $name): string
function duplicateArgumentMessage (line 330) | function duplicateArgumentMessage(string $argumentName): string
function duplicateDirectiveMessage (line 339) | function duplicateDirectiveMessage(string $directiveName): string
function duplicateFragmentMessage (line 348) | function duplicateFragmentMessage(string $fragmentName): string
function duplicateInputFieldMessage (line 357) | function duplicateInputFieldMessage(string $fieldName): string
function duplicateOperationMessage (line 366) | function duplicateOperationMessage(string $operationName): string
function duplicateVariableMessage (line 375) | function duplicateVariableMessage(string $variableName): string
function nonInputTypeOnVariableMessage (line 385) | function nonInputTypeOnVariableMessage(string $variableName, string $typ...
function variableDefaultValueNotAllowedMessage (line 396) | function variableDefaultValueNotAllowedMessage(string $variableName, str...
function badVariablePositionMessage (line 412) | function badVariablePositionMessage(string $variableName, string $typeNa...
function badValueMessage (line 428) | function badValueMessage(string $typeName, string $valueName, ?string $m...
function requiredFieldMessage (line 439) | function requiredFieldMessage(string $typeName, string $fieldName, strin...
function unknownFieldMessage (line 450) | function unknownFieldMessage(string $typeName, string $fieldName, ?strin...
FILE: src/api.php
function buildSchema (line 31) | function buildSchema($source, $resolverRegistry = [], array $options = [...
function extendSchema (line 48) | function extendSchema(Schema $schema, $source, $resolverRegistry = [], a...
function validateSchema (line 61) | function validateSchema(Schema $schema): array
function parse (line 73) | function parse($source, array $options = []): DocumentNode
function parseValue (line 89) | function parseValue($source, array $options = []): ValueNodeInterface
function parseType (line 105) | function parseType($source, array $options = []): TypeNodeInterface
function validate (line 119) | function validate(Schema $schema, DocumentNode $document): array
function execute (line 135) | function execute(
function executeAsync (line 182) | function executeAsync(
function printNode (line 208) | function printNode(NodeInterface $node): string
function graphql (line 226) | function graphql(
function graphqlAsync (line 279) | function graphqlAsync(
FILE: tests/Functional/Execution/AbstractPromiseTest.php
class AbstractPromiseTest (line 19) | class AbstractPromiseTest extends TestCase
method testIsTypeOfUsedToResolveFunctionForInterface (line 26) | public function testIsTypeOfUsedToResolveFunctionForInterface()
method testIsTypeOfCanBeRejected (line 115) | public function testIsTypeOfCanBeRejected()
method testIsTypeOfUsedToResolveRuntimeTypeForUnion (line 212) | public function testIsTypeOfUsedToResolveRuntimeTypeForUnion()
method testResolveTypeOnInterfaceYieldsUsefulError (line 306) | public function testResolveTypeOnInterfaceYieldsUsefulError()
method testResolveTypeOnUnionYieldsUsefulError (line 413) | public function testResolveTypeOnUnionYieldsUsefulError()
method testResolveTypeAllowsResolvingWithTypeName (line 534) | public function testResolveTypeAllowsResolvingWithTypeName()
method testResolveTypeCanBeCaught (line 627) | public function testResolveTypeCanBeCaught()
FILE: tests/Functional/Execution/AbstractTest.php
class AbstractTest (line 18) | class AbstractTest extends TestCase
method testIsTypeOfUsedToResolveFunctionForInterface (line 28) | public function testIsTypeOfUsedToResolveFunctionForInterface()
method testIsTypeOfUsedToResolveRuntimeTypeForUnion (line 116) | public function testIsTypeOfUsedToResolveRuntimeTypeForUnion()
method testResolveTypeOnInterfaceYieldsUsefulError (line 210) | public function testResolveTypeOnInterfaceYieldsUsefulError()
method testResolveTypeOnUnionYieldsUseFulError (line 329) | public function testResolveTypeOnUnionYieldsUseFulError()
method testResolveTypeAllowsResolvingWithTypeName (line 447) | public function testResolveTypeAllowsResolvingWithTypeName()
FILE: tests/Functional/Execution/DeferredResolverTest.php
class DirectorBuffer (line 12) | class DirectorBuffer
method add (line 18) | public static function add(int $id)
method get (line 23) | public static function get(int $id)
method loadBuffered (line 28) | public static function loadBuffered(): void
class DeferredResolverTest (line 41) | class DeferredResolverTest extends ResolveTest
method testUsingFieldDeferredResolver (line 47) | public function testUsingFieldDeferredResolver()
FILE: tests/Functional/Execution/DirectivesTest.php
class DirectivesTest (line 14) | class DirectivesTest extends TestCase
method setUp (line 29) | public function setUp()
method testWorksWithDirective (line 52) | public function testWorksWithDirective()
method testIfTrueReturnScalar (line 65) | public function testIfTrueReturnScalar()
method testIfFalseOmitScalar (line 78) | public function testIfFalseOmitScalar()
method testUnlessFalseIncludesScalar (line 91) | public function testUnlessFalseIncludesScalar()
method testUnlessTrueOmitScalar (line 104) | public function testUnlessTrueOmitScalar()
method testIfFalseOmitsFragmentSpread (line 119) | public function testIfFalseOmitsFragmentSpread()
method testIfTrueIncludesFragmentSpread (line 141) | public function testIfTrueIncludesFragmentSpread()
method testUnlessFalseIncludesFragmentSpread (line 162) | public function testUnlessFalseIncludesFragmentSpread()
method testUnlessTrueOmitsFragmentSpread (line 183) | public function testUnlessTrueOmitsFragmentSpread()
method testIfFalseOmitsInlineFragment (line 206) | public function testIfFalseOmitsInlineFragment()
method testIfTrueIncludesInlineFragment (line 226) | public function testIfTrueIncludesInlineFragment()
method testUnlessFalseIncludesInlineFragment (line 246) | public function testUnlessFalseIncludesInlineFragment()
method testUnlessTrueIncludesInlineFragments (line 266) | public function testUnlessTrueIncludesInlineFragments()
method testIfFalseOmitsAnonymousInlineFragment (line 288) | public function testIfFalseOmitsAnonymousInlineFragment()
method testIfTrueIncludeAnonymousInlineFragment (line 308) | public function testIfTrueIncludeAnonymousInlineFragment()
method testUnlessFalseIncludesAnonymousInlineFragment (line 328) | public function testUnlessFalseIncludesAnonymousInlineFragment()
method testUnlessTrueIncludeAnonymousInlineFragment (line 348) | public function testUnlessTrueIncludeAnonymousInlineFragment()
method testIncludeAndNoSkip (line 370) | public function testIncludeAndNoSkip()
method testIncludeAndSkip (line 388) | public function testIncludeAndSkip()
method testNoIncludeOrSkip (line 406) | public function testNoIncludeOrSkip()
FILE: tests/Functional/Execution/ExecutionTest.php
class ExecutionTest (line 19) | class ExecutionTest extends TestCase
method testNoDocumentIsProvided (line 25) | public function testNoDocumentIsProvided()
method testNoSchemaIsProvided (line 48) | public function testNoSchemaIsProvided()
method testAcceptAnObjectWithNamedPropertiesAsArguments (line 59) | public function testAcceptAnObjectWithNamedPropertiesAsArguments()
method testExecuteHelloQuery (line 87) | public function testExecuteHelloQuery()
method testExecuteArbitraryCode (line 113) | public function testExecuteArbitraryCode()
method testExecuteQueryHelloWithArgs (line 289) | public function testExecuteQueryHelloWithArgs()
method testExecuteQueryWithMultipleFields (line 322) | public function testExecuteQueryWithMultipleFields()
method testMergeParallelFragments (line 379) | public function testMergeParallelFragments()
method testProvidesInfoAboutCurrentExecutionState (line 453) | public function testProvidesInfoAboutCurrentExecutionState()
method testThreadsRootValueContextCorrectly (line 498) | public function testThreadsRootValueContextCorrectly()
method testCorrectlyThreadsArguments (line 531) | public function testCorrectlyThreadsArguments()
method testNullsOutErrorsSubTrees (line 558) | public function testNullsOutErrorsSubTrees()
method testNullsErrorSubTreeForPromiseRejection (line 779) | public function testNullsErrorSubTreeForPromiseRejection()
method testFullResponsePathIsIncludedForNonNullableFields (line 833) | public function testFullResponsePathIsIncludedForNonNullableFields()
method testUsesTheInlineOperationIfNoOperationIsProvided (line 929) | public function testUsesTheInlineOperationIfNoOperationIsProvided()
method testUsesTheNamedOperationIfOperationNameIsProvided (line 959) | public function testUsesTheNamedOperationIfOperationNameIsProvided()
method testProvidesErrorIfNoOperationIsProvided (line 987) | public function testProvidesErrorIfNoOperationIsProvided()
method testErrorsIfNoOpNameIsProvidedWithMultipleOperations (line 1023) | public function testErrorsIfNoOpNameIsProvidedWithMultipleOperations()
method testErrorsIfUnknownOperationNameIsProvided (line 1058) | public function testErrorsIfUnknownOperationNameIsProvided()
method testUsesTheQuerySchemaForQueries (line 1094) | public function testUsesTheQuerySchemaForQueries()
method testUsesTheMutationSchemaForMutations (line 1141) | public function testUsesTheMutationSchemaForMutations()
method testUsesTheSubscriptionSchemaForSubscriptions (line 1180) | public function testUsesTheSubscriptionSchemaForSubscriptions()
method testCorrectFieldOrderingDespiteExecutionOrder (line 1219) | public function testCorrectFieldOrderingDespiteExecutionOrder()
method testAvoidRecursions (line 1275) | public function testAvoidRecursions()
method testDoesNotIncludeIllegalFieldsInOutput (line 1315) | public function testDoesNotIncludeIllegalFieldsInOutput()
method testFailsWhenAnIsTypeOfCheckIsNotMet (line 1346) | public function testFailsWhenAnIsTypeOfCheckIsNotMet()
method testExecutesIgnoringInvalidNonExecutableDefinitions (line 1415) | public function testExecutesIgnoringInvalidNonExecutableDefinitions()
method testUsesACustomFieldResolver (line 1444) | public function testUsesACustomFieldResolver()
method testNonNullFieldQuery (line 1474) | public function testNonNullFieldQuery()
class Special (line 1508) | class Special
method __construct (line 1512) | public function __construct($value)
class NotSpecial (line 1518) | class NotSpecial
method __construct (line 1522) | public function __construct($value)
FILE: tests/Functional/Execution/ListTest.php
class ListTest (line 16) | class ListTest extends TestCase
method makeTest (line 27) | public function makeTest(TypeInterface $testType, $testData, $expected)
method testAcceptAnArrayObjectAsListValue (line 63) | public function testAcceptAnArrayObjectAsListValue()
method testAcceptsAGeneratorAsFunctionValue (line 82) | public function testAcceptsAGeneratorAsFunctionValue()
method testDoesNotAcceptStringAsIterable (line 104) | public function testDoesNotAcceptStringAsIterable()
method testArrayContainsValues (line 135) | public function testArrayContainsValues()
method testArrayContainsNull (line 154) | public function testArrayContainsNull()
method testArrayReturnsNull (line 172) | public function testArrayReturnsNull()
method testPromiseContainsValues (line 190) | public function testPromiseContainsValues()
method testPromiseContainsNull (line 209) | public function testPromiseContainsNull()
method testPromiseReturnsNull (line 227) | public function testPromiseReturnsNull()
method testPromiseReject (line 245) | public function testPromiseReject()
method testArrayPromiseContainsValues (line 275) | public function testArrayPromiseContainsValues()
method testArrayPromiseContainsNull (line 297) | public function testArrayPromiseContainsNull()
method testArrayPromiseContainsReject (line 319) | public function testArrayPromiseContainsReject()
FILE: tests/Functional/Execution/MutationTest.php
class MutationTest (line 17) | class MutationTest extends TestCase
method testSimpleMutation (line 24) | public function testSimpleMutation()
method testEvaluatesMutationsSerially (line 68) | public function testEvaluatesMutationsSerially()
method testEvaluatesMutationsCorrectlyInThePresenceOfAvailedMutation (line 118) | public function testEvaluatesMutationsCorrectlyInThePresenceOfAvailedM...
class NumberHolder (line 178) | class NumberHolder
method __construct (line 189) | public function __construct(int $originalNumber)
class Root (line 195) | class Root
method __construct (line 203) | public function __construct(int $originalNumber)
method immediatelyChangeTheNumber (line 212) | public function immediatelyChangeTheNumber(int $newNumber)
method promiseToChangeTheNumber (line 223) | public function promiseToChangeTheNumber(int $newNumber)
method failToChangeTheNumber (line 233) | public function failToChangeTheNumber()
method promiseAndFailToChangeTheNumber (line 241) | public function promiseAndFailToChangeTheNumber()
function rootSchema (line 249) | function rootSchema(): Schema
FILE: tests/Functional/Execution/NonNullTest.php
class NonNullTest (line 11) | class NonNullTest extends TestCase
method setUp (line 18) | protected function setUp()
method testSucceedsWhenPassedNonNullLiteralValue (line 45) | public function testSucceedsWhenPassedNonNullLiteralValue()
method testSucceedsWhenPassedNonNullVariableValue (line 59) | public function testSucceedsWhenPassedNonNullVariableValue()
method testSucceedsWhenMissingVariableHasDefaultValue (line 74) | public function testSucceedsWhenMissingVariableHasDefaultValue()
method testFieldErrorWhenMissingNonNullArg (line 90) | public function testFieldErrorWhenMissingNonNullArg()
method testFieldErrorWhenNonNullArgProvidedNull (line 119) | public function testFieldErrorWhenNonNullArgProvidedNull()
method testFieldErrorWhenNonNullArgNotProvidedVariableValue (line 148) | public function testFieldErrorWhenNonNullArgNotProvidedVariableValue()
method testFieldErrorWhenNonNullArgProvidedVariableWithExplicitNullValue (line 180) | public function testFieldErrorWhenNonNullArgProvidedVariableWithExplic...
method assertQueryResult (line 212) | private function assertQueryResult(string $query, array $expected, arr...
FILE: tests/Functional/Execution/ResolveTest.php
class ResolveTest (line 12) | class ResolveTest extends TestCase
method createTestSchema (line 15) | protected function createTestSchema($testField)
method testDefaultFunctionAccessProperties (line 35) | public function testDefaultFunctionAccessProperties()
method testDefaultFunctionCallsMethods (line 55) | public function testDefaultFunctionCallsMethods()
method testDefaultFunctionPassesArgsAndContext (line 79) | public function testDefaultFunctionPassesArgsAndContext()
method testUsesProvidedResolveFunction (line 115) | public function testUsesProvidedResolveFunction()
FILE: tests/Functional/Execution/SchemaTest.php
class SchemaTest (line 20) | class SchemaTest extends TestCase
method testExecutesUsingASchema (line 31) | public function testExecutesUsingASchema()
method testExecuteUsingASchemaWithCustomScalarType (line 251) | public function testExecuteUsingASchemaWithCustomScalarType()
FILE: tests/Functional/Execution/UnionInterfaceTest.php
class UnionInterfaceTest (line 17) | class UnionInterfaceTest extends TestCase
method setUp (line 29) | public function setUp()
method testCanIntrospectOnUnionAndIntersectionTypes (line 117) | public function testCanIntrospectOnUnionAndIntersectionTypes()
method testExecutesUsingUnionTypes (line 179) | public function testExecutesUsingUnionTypes()
method testExecutesUnionTypesWithInlineFragments (line 211) | public function testExecutesUnionTypesWithInlineFragments()
method testExecutesUsingInterfaceTypes (line 248) | public function testExecutesUsingInterfaceTypes()
method testExecutesUnionTypesWithInlineFragmentsTwo (line 280) | public function testExecutesUnionTypesWithInlineFragmentsTwo()
method testAllowsFragmentConditionsToBeAbstractTypes (line 316) | public function testAllowsFragmentConditionsToBeAbstractTypes()
method testGetsExecutionInfoInResolver (line 371) | public function testGetsExecutionInfoInResolver()
FILE: tests/Functional/Execution/ValuesResolverTest.php
class ValuesResolverTest (line 18) | class ValuesResolverTest extends TestCase
method setUp (line 28) | protected function setUp()
method testCoerceArgumentValues (line 39) | public function testCoerceArgumentValues()
method testCoerceVariableValues (line 77) | public function testCoerceVariableValues(): void
method testCoerceValuesForInputObjectTypes (line 125) | public function testCoerceValuesForInputObjectTypes(): void
FILE: tests/Functional/Execution/VariablesTest.php
class VariablesTest (line 27) | class VariablesTest extends TestCase
method setUp (line 35) | protected function setUp()
method fieldWithInputArg (line 128) | function fieldWithInputArg(array $inputArg): array
method testExecutesWithComplexInput (line 145) | public function testExecutesWithComplexInput()
method testVariableNotProvided (line 159) | public function testVariableNotProvided()
method testVariableWithExplicitNullValue (line 175) | public function testVariableWithExplicitNullValue()
method testUsesDefaultValueWhenValueNotProvided (line 190) | public function testUsesDefaultValueWhenValueNotProvided()
method testDoesNotUseDefaultValueWhenValueProvided (line 204) | public function testDoesNotUseDefaultValueWhenValueProvided()
method testUsesExplicitNullValueInsteadOfDefaultValue (line 219) | public function testUsesExplicitNullValueInsteadOfDefaultValue()
method testUsesNullDefaultValueWhenValueNotProvided (line 234) | public function testUsesNullDefaultValueWhenValueNotProvided()
method testProperlyParsesSingleValueToList (line 250) | public function testProperlyParsesSingleValueToList()
method testProperlyParsesNullValueToNull (line 264) | public function testProperlyParsesNullValueToNull()
method testProperlyParsesNullValueInList (line 278) | public function testProperlyParsesNullValueInList()
method testDoesNotUseIncorrectValue (line 292) | public function testDoesNotUseIncorrectValue()
method testProperlyRunsParseLiteralOnComplexScalarTypes (line 313) | public function testProperlyRunsParseLiteralOnComplexScalarTypes()
method testExecutesWithComplexInputUsingVariables (line 329) | public function testExecutesWithComplexInputUsingVariables()
method testUseDefaultValueWhenNotProvide (line 344) | public function testUseDefaultValueWhenNotProvide()
method testProperlyParsesSingleValueToListUsingVariable (line 358) | public function testProperlyParsesSingleValueToListUsingVariable()
method testExecutesWithComplexScalarInputUsingVariable (line 373) | public function testExecutesWithComplexScalarInputUsingVariable()
method testErrorsOnNullForNestedNonNullUsingVariable (line 388) | public function testErrorsOnNullForNestedNonNullUsingVariable()
method testErrorsOnDeepNestedErrorsWithManyErrors (line 413) | public function testErrorsOnDeepNestedErrorsWithManyErrors()
method testErrorsOnAdditionOfUnknownInputField (line 448) | public function testErrorsOnAdditionOfUnknownInputField()
method testAllowsNullableInputsToBeOmitted (line 476) | public function testAllowsNullableInputsToBeOmitted()
method testAllowsNullableInputsToBeOmittedInAVariable (line 490) | public function testAllowsNullableInputsToBeOmittedInAVariable()
method testAllowsNullableInputsToBeOmittedInUnlistedVariable (line 504) | public function testAllowsNullableInputsToBeOmittedInUnlistedVariable()
method testAllowsNullableInputsToBeSetToNullInVariable (line 518) | public function testAllowsNullableInputsToBeSetToNullInVariable()
method testAllowsNullableInputsToBeSetToAValueDirectly (line 533) | public function testAllowsNullableInputsToBeSetToAValueDirectly()
method testAllowsNonNullableInputsToBeOmittedGivenADefault (line 549) | public function testAllowsNonNullableInputsToBeOmittedGivenADefault()
method testDoesNotAllowNonNullableInputsToBeOmittedInAVariable (line 563) | public function testDoesNotAllowNonNullableInputsToBeOmittedInAVariable()
method testDoesNotAllowNonNullabeInputsToBeSetToNullInAVariable (line 586) | public function testDoesNotAllowNonNullabeInputsToBeSetToNullInAVariab...
method testAllowsNonNullableInputsToBeSetToAValueInAVariable (line 610) | public function testAllowsNonNullableInputsToBeSetToAValueInAVariable()
method testAllowsNonNullableInputsToBeSetToAValueDirectly (line 625) | public function testAllowsNonNullableInputsToBeSetToAValueDirectly()
method testReportErrorForMissingNonNullableInputs (line 639) | public function testReportErrorForMissingNonNullableInputs()
method testReportErrorForArrayPassedIntoStringInput (line 663) | public function testReportErrorForArrayPassedIntoStringInput()
method testSerializingAnArrayViaGraphQLStringThrowsTypeError (line 688) | public function testSerializingAnArrayViaGraphQLStringThrowsTypeError()
method testReportErrorForNonProvidedVariableForNonNullableInputs (line 695) | public function testReportErrorForNonProvidedVariableForNonNullableInp...
method testAllowsListsToBeNull (line 730) | public function testAllowsListsToBeNull()
method testAllowsListsContainValues (line 745) | public function testAllowsListsContainValues()
method testAllowsListsContainNull (line 761) | public function testAllowsListsContainNull()
method testDoesNotAllowNonNullListsToBeNull (line 776) | public function testDoesNotAllowNonNullListsToBeNull()
method testAllowsNonNullListsToContainValues (line 801) | public function testAllowsNonNullListsToContainValues()
method testAllowsListsOfNonNullsToBeNull (line 816) | public function testAllowsListsOfNonNullsToBeNull()
method testAllowsListsOfNonNullsToContainValues (line 831) | public function testAllowsListsOfNonNullsToContainValues()
method testDoesNotAllowsListsOfNonNullsToContainNull (line 846) | public function testDoesNotAllowsListsOfNonNullsToContainNull()
method testDoesNotAllowsListsOfNonNullsToBeNull (line 871) | public function testDoesNotAllowsListsOfNonNullsToBeNull()
method testDoesNotAllowsNonNullListsOfNonNullsToContainNull (line 895) | public function testDoesNotAllowsNonNullListsOfNonNullsToContainNull()
method testDoesNotAllowsInvalidTypesToBeUsedAsValues (line 920) | public function testDoesNotAllowsInvalidTypesToBeUsedAsValues()
method testDoesNotAllowsUnknownTypesToBeUsedAsValues (line 945) | public function testDoesNotAllowsUnknownTypesToBeUsedAsValues()
method testWhenNoArgumentProvided (line 972) | public function testWhenNoArgumentProvided()
method testWhenOmittedVariableProvided (line 982) | public function testWhenOmittedVariableProvided()
method testNotWhenArgumentCannotBeCoerced (line 994) | public function testNotWhenArgumentCannotBeCoerced()
method testCustomDateTimeScalarType (line 1020) | public function testCustomDateTimeScalarType()
method assertQueryResult (line 1083) | protected function assertQueryResult(string $query, array $expected, a...
FILE: tests/Functional/Execution/testClasses.php
class Human (line 5) | class Human
method __construct (line 9) | public function __construct(string $name)
class Person (line 15) | class Person
method __construct (line 21) | public function __construct(string $name, array $pets = [], array $fri...
class Dog (line 29) | class Dog
method __construct (line 34) | public function __construct(string $name, bool $woofs)
class Cat (line 41) | class Cat
method __construct (line 46) | public function __construct(string $name, bool $meows)
FILE: tests/Functional/IntrospectionTest.php
class IntrospectionTest (line 9) | class IntrospectionTest extends TestCase
method testAllowsQueryingTheSchemaForTypes (line 17) | public function testAllowsQueryingTheSchemaForTypes()
method testAllowsQueryingTheSchemaForQueryType (line 59) | public function testAllowsQueryingTheSchemaForQueryType()
method testAllowsQueryingTheSchemaForASpecificType (line 87) | public function testAllowsQueryingTheSchemaForASpecificType()
method testAllowsQueryingTheSchemaForAnObjectKind (line 111) | public function testAllowsQueryingTheSchemaForAnObjectKind()
method testAllowsQueryingTheSchemaForAnInterfaceKind (line 137) | public function testAllowsQueryingTheSchemaForAnInterfaceKind()
method testAllowsQueryingTheSchemaForObjectFields (line 163) | public function testAllowsQueryingTheSchemaForObjectFields()
method testAllowsQueryingTheSchemaForNestedObjectFields (line 238) | public function testAllowsQueryingTheSchemaForNestedObjectFields()
method testAllowsQueryingTheSchemaForFieldArguments (line 332) | public function testAllowsQueryingTheSchemaForFieldArguments()
method testAllowsQueryingTheSchemaForDocumentation (line 430) | public function testAllowsQueryingTheSchemaForDocumentation()
method testCanIntrospectOnANonClashingScalar (line 458) | public function testCanIntrospectOnANonClashingScalar()
method testCanIntrospectOnScalarWithClashingName (line 494) | public function testCanIntrospectOnScalarWithClashingName()
FILE: tests/Functional/Language/FileSourceBuilderTest.php
class FileSourceBuilderTest (line 12) | class FileSourceBuilderTest extends TestCase
method testFileNotFound (line 19) | public function testFileNotFound(): void
method testSuccess (line 30) | public function testSuccess(): void
FILE: tests/Functional/Language/MultiFileSourceBuilderTest.php
class MultiFileSourceBuilderTest (line 12) | class MultiFileSourceBuilderTest extends TestCase
method testBuildSource (line 19) | public function testBuildSource(): void
FILE: tests/Functional/Language/ParserTest.php
class ParserTest (line 24) | class ParserTest extends TestCase
method testParsePartial (line 30) | public function testParsePartial()
method testParseProvidesUsefulErrors (line 80) | public function testParseProvidesUsefulErrors()
method testParsesVariableInlineValues (line 93) | public function testParsesVariableInlineValues()
method testParsesConstantDefaultValues (line 100) | public function testParsesConstantDefaultValues()
method testDoesNotAcceptFragmentsNamedOn (line 109) | public function testDoesNotAcceptFragmentsNamedOn()
method testDoesNotAcceptFragmentSpreadOfOn (line 118) | public function testDoesNotAcceptFragmentSpreadOfOn()
method testParsesMultiByteCharacters (line 127) | public function testParsesMultiByteCharacters()
method testParsesKitchenSink (line 157) | public function testParsesKitchenSink()
method testAllowsNonKeywordsAnywhereANameIsAllowed (line 166) | public function testAllowsNonKeywordsAnywhereANameIsAllowed()
method testParsesAnonMutationOperations (line 202) | public function testParsesAnonMutationOperations()
method testParsesAnonSubscriptionOperations (line 213) | public function testParsesAnonSubscriptionOperations()
method testParsesNamedMutationOperations (line 224) | public function testParsesNamedMutationOperations()
method testParsesNamedSubscriptionOperations (line 235) | public function testParsesNamedSubscriptionOperations()
method testCreatesAST (line 246) | public function testCreatesAST()
method testCreatesAstFromNamelessQueryWithoutVariables (line 339) | public function testCreatesAstFromNamelessQueryWithoutVariables()
method testParsesNullValue (line 413) | public function testParsesNullValue()
method testParsesListValue (line 424) | public function testParsesListValue()
method testParsesBlockStrings (line 448) | public function testParsesBlockStrings()
method testParsesWellKnownTypes (line 474) | public function testParsesWellKnownTypes()
method testParsesCustomTypes (line 490) | public function testParsesCustomTypes()
method testParsesListTypes (line 506) | public function testParsesListTypes()
method testParsesNonNullTypes (line 526) | public function testParsesNonNullTypes()
method testParsesNestedTypes (line 546) | public function testParsesNestedTypes()
method testParsesGitHubIssue253 (line 575) | public function testParsesGitHubIssue253(): void
FILE: tests/Functional/Language/SchemaParserTest.php
class SchemaParserTest (line 13) | class SchemaParserTest extends TestCase
method testSimpleType (line 16) | public function testSimpleType()
method testParsesWithDescriptionString (line 47) | public function testParsesWithDescriptionString()
method testParsesWithDescriptionMultiLineString (line 73) | public function testParsesWithDescriptionMultiLineString()
method testSimpleExtension (line 102) | public function testSimpleExtension()
method testExtensionWithoutFields (line 132) | public function testExtensionWithoutFields()
method testExtensionWithoutFieldsFollowedByExtension (line 155) | public function testExtensionWithoutFieldsFollowedByExtension()
method testExtensionWithoutAnythingThrows (line 192) | public function testExtensionWithoutAnythingThrows()
method testExtensionsDoNotIncludeDescriptions (line 200) | public function testExtensionsDoNotIncludeDescriptions()
method testSchemaExtension (line 220) | public function testSchemaExtension()
method testSchemaExtensionWithOnlyDirectives (line 250) | public function testSchemaExtensionWithOnlyDirectives()
method testSimpleNonNullType (line 276) | public function testSimpleNonNullType()
method testSimpleTypeInheritingInterface (line 311) | public function testSimpleTypeInheritingInterface()
method testSimpleTypeInheritingMultipleInterface (line 341) | public function testSimpleTypeInheritingMultipleInterface()
method testSimpleTypeInheritingMultipleInterfaceWithLeadingAmpersand (line 372) | public function testSimpleTypeInheritingMultipleInterfaceWithLeadingAm...
method testSingleValueEnum (line 403) | public function testSingleValueEnum()
method testDoubleValueEnum (line 426) | public function testDoubleValueEnum()
method testSimpleInterface (line 450) | public function testSimpleInterface()
method parseSimpleFieldWithArgument (line 480) | public function parseSimpleFieldWithArgument()
method testSimpleFieldWithArgumentWithDefaultValue (line 519) | public function testSimpleFieldWithArgumentWithDefaultValue()
method testSimpleFieldWithListArgument (line 562) | public function testSimpleFieldWithListArgument()
method parseSimpleFieldWithTwoArguments (line 605) | public function parseSimpleFieldWithTwoArguments()
method testSimpleUnion (line 650) | public function testSimpleUnion()
method testSimpleUnionWithTypes (line 673) | public function testSimpleUnionWithTypes()
method testSimpleUnionWithTypesAndLeadingPipe (line 697) | public function testSimpleUnionWithTypesAndLeadingPipe()
method testUnionFailsWithNoTypes (line 721) | public function testUnionFailsWithNoTypes()
method testUnionFailsWithLeadingDoublePipe (line 729) | public function testUnionFailsWithLeadingDoublePipe()
method testUnionFailsWithTrailingPipe (line 737) | public function testUnionFailsWithTrailingPipe()
method testSimpleScalar (line 745) | public function testSimpleScalar()
method testSimpleInputObject (line 765) | public function testSimpleInputObject()
method testSimpleInputObjectWithArgumentsShouldFail (line 796) | public function testSimpleInputObjectWithArgumentsShouldFail()
method testDirectiveWithIncorrectLocations (line 807) | public function testDirectiveWithIncorrectLocations()
method typeNode (line 816) | protected function typeNode($name, $loc)
method nameNode (line 825) | protected function nameNode($name, $loc)
method fieldNode (line 834) | protected function fieldNode($name, $type, $loc)
method fieldNodeWithArguments (line 839) | protected function fieldNodeWithArguments($name, $type, $arguments, $loc)
method enumValueNode (line 852) | protected function enumValueNode($name, $loc)
method inputValueNode (line 863) | protected function inputValueNode($name, $type, $defaultValue, $loc)
FILE: tests/Functional/Language/SchemaPrinterTest.php
class SchemaPrinterTest (line 11) | class SchemaPrinterTest extends TestCase
method testDoesNotAlterAST (line 13) | public function testDoesNotAlterAST()
FILE: tests/Functional/Language/StringSourceBuilderTest.php
class StringSourceBuilderTest (line 8) | class StringSourceBuilderTest extends TestCase
method testBuild (line 14) | public function testBuild(): void
FILE: tests/Functional/Language/VisitorTest.php
class VisitorTest (line 26) | class VisitorTest extends TestCase
method testValidatesPathArgument (line 28) | public function testValidatesPathArgument()
method testAllowsForEditingOnEnter (line 65) | public function testAllowsForEditingOnEnter()
method testAllowsForEditingOnLeave (line 96) | public function testAllowsForEditingOnLeave()
method testVisitsEditedNode (line 128) | public function testVisitsEditedNode()
method testAllowsSkippingSubTree (line 164) | public function testAllowsSkippingSubTree()
method testAllowsEarlyExitWhileVisiting (line 210) | public function testAllowsEarlyExitWhileVisiting()
method testAllowsEarlyExitWhileLeaving (line 256) | public function testAllowsEarlyExitWhileLeaving()
method testAllowsAKindVisitor (line 303) | public function testAllowsAKindVisitor()
method testVisitsVariablesDefinedInFragments (line 344) | public function testVisitsVariablesDefinedInFragments()
method testVisitsKitchenSink (line 401) | public function testVisitsKitchenSink()
method testVisitInParallel (line 746) | public function testVisitInParallel()
method testAllowsSkippingSubTreeWhenVisitingInParallel (line 796) | public function testAllowsSkippingSubTreeWhenVisitingInParallel()
method testAllowsEarlyExitWhileEnteringWhenVisitingInParallel (line 901) | public function testAllowsEarlyExitWhileEnteringWhenVisitingInParallel()
method testAllowsEarlyExitWhileLeavingWhenVisitingInParallel (line 949) | public function testAllowsEarlyExitWhileLeavingWhenVisitingInParallel()
method testAllowsEarlyExitFromDifferentPointsWhenVisitingInParallel (line 998) | public function testAllowsEarlyExitFromDifferentPointsWhenVisitingInPa...
method testMaintainsTypeInfoDuringVisit (line 1089) | public function testMaintainsTypeInfoDuringVisit()
method testMaintainsTypeInfoDuringEdit (line 1182) | public function testMaintainsTypeInfoDuringEdit()
class AddedFieldNode (line 1308) | class AddedFieldNode extends FieldNode
FILE: tests/Functional/QueryTest.php
class QueryTest (line 9) | class QueryTest extends TestCase
method testCorrectlyIdentifiesR2D2AsTheHeroOfTheStarWarsSaga (line 17) | public function testCorrectlyIdentifiesR2D2AsTheHeroOfTheStarWarsSaga()
method testAllowsUsToQueryForTheIDAndFieldsOfR2D2 (line 43) | public function testAllowsUsToQueryForTheIDAndFieldsOfR2D2()
method testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2 (line 79) | public function testAllowsUsToQueryForTheFriendsOfFriendsOfR2D2()
method testAllowsUsToQueryForLukeSkywalkerDirectlyUsingHisID (line 143) | public function testAllowsUsToQueryForLukeSkywalkerDirectlyUsingHisID()
method testAllowsUsToCreateAGenericQueryThenUseItToFetchLukeSkywalkerUsingHisID (line 167) | public function testAllowsUsToCreateAGenericQueryThenUseItToFetchLukeS...
method testAllowsUsToCreateAGenericQueryThenUseItToFetchHanSoloUsingHisID (line 191) | public function testAllowsUsToCreateAGenericQueryThenUseItToFetchHanSo...
method testAllowsUsToCreateAGenericQueryThenPassAnInvalidIdToGetBackNull (line 215) | public function testAllowsUsToCreateAGenericQueryThenPassAnInvalidIdTo...
method testAllowsUsToQueryForLukeChangingHisKeyWithAnAlias (line 239) | public function testAllowsUsToQueryForLukeChangingHisKeyWithAnAlias()
method testAllowsUsToQueryForBothLukeAndLeiaUsingTwoRootFieldsAndAnAlias (line 263) | public function testAllowsUsToQueryForBothLukeAndLeiaUsingTwoRootField...
method testAllowsUsToQueryUsingDuplicatedContent (line 295) | public function testAllowsUsToQueryUsingDuplicatedContent()
method testAllowsUstoUseAFragmentToAvoidDuplicatingContent (line 329) | public function testAllowsUstoUseAFragmentToAvoidDuplicatingContent()
method testAllowsUsToVerifyThatR2D2IsADroid (line 368) | public function testAllowsUsToVerifyThatR2D2IsADroid()
method testAllowsUsToVerifyThatLukeIsAHuman (line 394) | public function testAllowsUsToVerifyThatLukeIsAHuman()
method testCorrectlyReportsErrorOnAccessingSecretBackstory (line 422) | public function testCorrectlyReportsErrorOnAccessingSecretBackstory()
method testCorrectlyReportsErrorOnAccessingSecretBackstoryInAList (line 455) | public function testCorrectlyReportsErrorOnAccessingSecretBackstoryInA...
method testCorrectlyReportsErrorOnAccessingThroughAnAlias (line 514) | public function testCorrectlyReportsErrorOnAccessingThroughAnAlias()
FILE: tests/Functional/Schema/BuildingTest.php
class BuildingTest (line 10) | class BuildingTest extends TestCase
method testBuildsSchema (line 12) | public function testBuildsSchema()
FILE: tests/Functional/Schema/DefinitionPrinterTest.php
class DefinitionPrinterTest (line 14) | class DefinitionPrinterTest extends TestCase
method testPrintStringFields (line 25) | public function testPrintStringFields(string $source): void
method printStringFieldsDataProvider (line 33) | public function printStringFieldsDataProvider(): array
method testPrintObjectFields (line 165) | public function testPrintObjectFields(): void
method testPrintCustomRootQuery (line 184) | public function testPrintCustomRootQuery(): void
method testPrintInterfaces (line 203) | public function testPrintInterfaces(): void
method testPrintUnions (line 249) | public function testPrintUnions(): void
method testPrintInputType (line 277) | public function testPrintInputType(): void
method testPrintCustomScalar (line 296) | public function testPrintCustomScalar(): void
method
Condensed preview — 414 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,757K chars).
[
{
"path": ".github/CONTRIBUTING.md",
"chars": 187,
"preview": "# Contributing\n\nPlease note the following guidelines before submitting pull requests:\n\n- All new features must be covere"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 356,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\n\n---\n\n### What did you do?\n\n### What did you expect to ha"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 508,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\n\n---\n\n**Is your feature request related to a problem? "
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 139,
"preview": "(Please read the [guidelines](.github/CONTRIBUTING.md) before creating PRs.)\n\nFixes #.\n\nChanges proposed in this pull re"
},
{
"path": ".github/workflows/test.yml",
"chars": 941,
"preview": "name: Test\n\non: [push, pull_request, workflow_dispatch]\n\nenv:\n FORCE_COLOR: 1\n\njobs:\n build:\n runs-on: ${{ matrix.o"
},
{
"path": ".gitignore",
"chars": 271,
"preview": "/.idea/dictionaries\n/.idea/deployment.xml\n/.idea/webServers.xml\n/.idea/workspace.xml\n/.idea/php-test-framework.xml\n/cove"
},
{
"path": ".idea/codeStyles/Project.xml",
"chars": 1757,
"preview": "<component name=\"ProjectCodeStyleConfiguration\">\n <code_scheme name=\"Project\" version=\"173\">\n <option name=\"WRAP_WHE"
},
{
"path": ".idea/codeStyles/codeStyleConfig.xml",
"chars": 142,
"preview": "<component name=\"ProjectCodeStyleConfiguration\">\n <state>\n <option name=\"USE_PER_PROJECT_SETTINGS\" value=\"true\" />\n "
},
{
"path": ".idea/graphql-php.iml",
"chars": 2808,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n <component name=\"NewModuleRootManager\">\n"
},
{
"path": ".idea/inspectionProfiles/Project_Default.xml",
"chars": 5648,
"preview": "<component name=\"InspectionProjectProfileManager\">\n <profile version=\"1.0\">\n <option name=\"myName\" value=\"Project De"
},
{
"path": ".idea/modules.xml",
"chars": 274,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectModuleManager\">\n <modules>\n "
},
{
"path": ".idea/php.xml",
"chars": 3577,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"PhpIncludePathManager\">\n <include_pat"
},
{
"path": ".idea/vcs.xml",
"chars": 180,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"VcsDirectoryMappings\">\n <mapping dire"
},
{
"path": "CHANGELOG.md",
"chars": 1308,
"preview": "# Change log\n\n## 1.1.0\n\n* Add initial support for execution strategies\n* Add support for error handling middleware \n* Fi"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3223,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "LICENSE",
"chars": 1062,
"preview": "MIT License\n\nCopyright (c) 2018 Digia\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof t"
},
{
"path": "README.md",
"chars": 16917,
"preview": "# GraphQL\n\n[](https://githu"
},
{
"path": "composer.json",
"chars": 1993,
"preview": "{\n \"name\": \"digiaonline/graphql\",\n \"description\": \"A PHP7 implementation of the GraphQL specifications.\",\n \"typ"
},
{
"path": "phpunit.xml.dist",
"chars": 709,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNam"
},
{
"path": "src/Error/AbstractException.php",
"chars": 163,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\n/**\n * Class AbstractException\n * @package Digia\\GraphQL\\Error\n */\nabstract class"
},
{
"path": "src/Error/FileNotFoundException.php",
"chars": 169,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\n/**\n * Class FileNotFoundException\n * @package Digia\\GraphQL\\Error\n */\nclass File"
},
{
"path": "src/Error/GraphQLException.php",
"chars": 8285,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\nuse Digia\\GraphQL\\Language\\Source;"
},
{
"path": "src/Error/Handler/AbstractErrorMiddleware.php",
"chars": 502,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error\\Handler;\n\nuse Digia\\GraphQL\\Execution\\ExecutionContext;\nuse Digia\\GraphQL\\Execution"
},
{
"path": "src/Error/Handler/CallableMiddleware.php",
"chars": 725,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error\\Handler;\n\nuse Digia\\GraphQL\\Execution\\ExecutionContext;\nuse Digia\\GraphQL\\Execution"
},
{
"path": "src/Error/Handler/ErrorHandler.php",
"chars": 1733,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error\\Handler;\n\nuse Digia\\GraphQL\\Execution\\ExecutionContext;\nuse Digia\\GraphQL\\Execution"
},
{
"path": "src/Error/Handler/ErrorHandlerInterface.php",
"chars": 502,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error\\Handler;\n\nuse Digia\\GraphQL\\Execution\\ExecutionContext;\nuse Digia\\GraphQL\\Execution"
},
{
"path": "src/Error/Handler/ErrorMiddlewareInterface.php",
"chars": 636,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error\\Handler;\n\nuse Digia\\GraphQL\\Execution\\ExecutionContext;\nuse Digia\\GraphQL\\Execution"
},
{
"path": "src/Error/InvalidTypeException.php",
"chars": 95,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\nclass InvalidTypeException extends GraphQLException\n{\n}\n"
},
{
"path": "src/Error/InvariantException.php",
"chars": 163,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\n/**\n * Class InvariantException\n * @package Digia\\GraphQL\\Error\n */\nclass Invaria"
},
{
"path": "src/Error/helpers.php",
"chars": 3537,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Error;\n\nuse Digia\\GraphQL\\Language\\Source;\nuse Digia\\GraphQL\\Language\\SourceLocation;\n\n//"
},
{
"path": "src/Execution/CoercedValue.php",
"chars": 1125,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\n\nclass CoercedValue\n{\n /**\n "
},
{
"path": "src/Execution/Execution.php",
"chars": 5952,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\Handler\\ErrorHandlerInterface;\nuse Digia\\GraphQL\\Exec"
},
{
"path": "src/Execution/ExecutionContext.php",
"chars": 4256,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Language\\Node\\FragmentDefinitionNode;\nuse Digia\\GraphQL\\Lan"
},
{
"path": "src/Execution/ExecutionException.php",
"chars": 140,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\n\nclass ExecutionException extends G"
},
{
"path": "src/Execution/ExecutionInterface.php",
"chars": 1067,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\Handler\\ErrorHandlerInterface;\nuse Digia\\GraphQL\\Lang"
},
{
"path": "src/Execution/ExecutionProvider.php",
"chars": 427,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse League\\Container\\ServiceProvider\\AbstractServiceProvider;\n\nclass Executio"
},
{
"path": "src/Execution/ExecutionResult.php",
"chars": 1509,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\nuse Digia\\GraphQL\\Util\\ArrayToJsonT"
},
{
"path": "src/Execution/InvalidReturnTypeException.php",
"chars": 700,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\nuse Digia\\GraphQL\\Type\\Definition\\T"
},
{
"path": "src/Execution/Path.php",
"chars": 670,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nclass Path\n{\n /**\n * @var Path|null\n */\n protected $previous;\n\n"
},
{
"path": "src/Execution/ResolveInfo.php",
"chars": 3578,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Language\\Node\\FieldNode;\nuse Digia\\GraphQL\\Language\\Node\\Op"
},
{
"path": "src/Execution/Strategy/AbstractExecutionStrategy.php",
"chars": 30483,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution\\Strategy;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\nuse Digia\\GraphQL\\Error\\In"
},
{
"path": "src/Execution/Strategy/ExecutionStrategyInterface.php",
"chars": 161,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution\\Strategy;\n\ninterface ExecutionStrategyInterface\n{\n /**\n * @return mixed\n"
},
{
"path": "src/Execution/Strategy/FieldCollector.php",
"chars": 4969,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution\\Strategy;\n\nuse Digia\\GraphQL\\Error\\InvalidTypeException;\nuse Digia\\GraphQL\\Erro"
},
{
"path": "src/Execution/Strategy/ParallelExecutionStrategy.php",
"chars": 1558,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution\\Strategy;\n\nuse Digia\\GraphQL\\Execution\\UndefinedFieldException;\nuse Digia\\Graph"
},
{
"path": "src/Execution/Strategy/SerialExecutionStrategy.php",
"chars": 1563,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution\\Strategy;\n\nuse Digia\\GraphQL\\Execution\\UndefinedFieldException;\nuse Digia\\Graph"
},
{
"path": "src/Execution/UndefinedFieldException.php",
"chars": 356,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\AbstractException;\n\nclass UndefinedFieldException ext"
},
{
"path": "src/Execution/ValuesResolver.php",
"chars": 23858,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Execution;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\nuse Digia\\GraphQL\\Error\\InvalidType"
},
{
"path": "src/GraphQL.php",
"chars": 11621,
"preview": "<?php\n\nnamespace Digia\\GraphQL;\n\nuse Digia\\GraphQL\\Error\\Handler\\ErrorHandlerInterface;\nuse Digia\\GraphQL\\Error\\Invarian"
},
{
"path": "src/Language/DirectiveLocationEnum.php",
"chars": 1405,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nclass DirectiveLocationEnum\n{\n\n // Request Definitions\n public const QUE"
},
{
"path": "src/Language/FileSourceBuilder.php",
"chars": 947,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\FileNotFoundException;\nuse Digia\\GraphQL\\Error\\Invaria"
},
{
"path": "src/Language/KeywordEnum.php",
"chars": 948,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nclass KeywordEnum\n{\n\n public const SCHEMA = 'schema';\n public cons"
},
{
"path": "src/Language/LanguageException.php",
"chars": 140,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\AbstractException;\n\nclass LanguageException extends Ab"
},
{
"path": "src/Language/LanguageProvider.php",
"chars": 652,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse League\\Container\\ServiceProvider\\AbstractServiceProvider;\n\nclass LanguageP"
},
{
"path": "src/Language/Lexer.php",
"chars": 20125,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\n/**\n * A Lexer is a stateful stream generator in that every time\n * it is adva"
},
{
"path": "src/Language/LexerInterface.php",
"chars": 1342,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\ninterface LexerInterface\n{\n /**\n * Advances the token stream to the nex"
},
{
"path": "src/Language/Location.php",
"chars": 1378,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Util\\ArrayToJsonTrait;\nuse Digia\\GraphQL\\Util\\SerializationI"
},
{
"path": "src/Language/MultiFileSourceBuilder.php",
"chars": 1099,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\FileNotFoundException;\nuse Digia\\GraphQL\\Error\\Invaria"
},
{
"path": "src/Language/Node/ASTNodeAwareInterface.php",
"chars": 260,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface ASTNodeAwareInterface\n{\n /**\n * @return bool\n */\n "
},
{
"path": "src/Language/Node/ASTNodeTrait.php",
"chars": 616,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait ASTNodeTrait\n{\n /**\n * @var ?NodeInterface\n */\n prote"
},
{
"path": "src/Language/Node/AbstractNode.php",
"chars": 10213,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\GraphQL;\nuse Digia\\GraphQL\\Language\\Location;\nuse Digia"
},
{
"path": "src/Language/Node/AliasTrait.php",
"chars": 1055,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait AliasTrait\n{\n\n /**\n * @var NameNode|null\n */\n protect"
},
{
"path": "src/Language/Node/ArgumentNode.php",
"chars": 904,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ArgumentNode extends Abstract"
},
{
"path": "src/Language/Node/ArgumentsAwareInterface.php",
"chars": 467,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface ArgumentsAwareInterface\n{\n /**\n * @return bool\n */\n "
},
{
"path": "src/Language/Node/ArgumentsTrait.php",
"chars": 842,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait ArgumentsTrait\n{\n /**\n * @var ArgumentNode[]\n */\n pro"
},
{
"path": "src/Language/Node/BooleanValueNode.php",
"chars": 738,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass BooleanValueNode extends Abst"
},
{
"path": "src/Language/Node/DefaultValueTrait.php",
"chars": 639,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait DefaultValueTrait\n{\n /**\n * @var ValueNodeInterface|null\n "
},
{
"path": "src/Language/Node/DefinitionNodeInterface.php",
"chars": 107,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface DefinitionNodeInterface extends NodeInterface\n{\n}\n"
},
{
"path": "src/Language/Node/DescriptionTrait.php",
"chars": 910,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait DescriptionTrait\n{\n /**\n * @var StringValueNode|null\n */"
},
{
"path": "src/Language/Node/DirectiveDefinitionNode.php",
"chars": 2063,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass DirectiveDefinitionNode exten"
},
{
"path": "src/Language/Node/DirectiveNode.php",
"chars": 942,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass DirectiveNode extends Abstrac"
},
{
"path": "src/Language/Node/DirectivesAwareInterface.php",
"chars": 476,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface DirectivesAwareInterface\n{\n /**\n * @return bool\n */\n"
},
{
"path": "src/Language/Node/DirectivesTrait.php",
"chars": 864,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait DirectivesTrait\n{\n /**\n * @var DirectiveNode[]\n */\n p"
},
{
"path": "src/Language/Node/DocumentNode.php",
"chars": 1517,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass DocumentNode extends Abstract"
},
{
"path": "src/Language/Node/EnumTypeDefinitionNode.php",
"chars": 1527,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass EnumTypeDefinitionNode extend"
},
{
"path": "src/Language/Node/EnumTypeExtensionNode.php",
"chars": 1235,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass EnumTypeExtensionNode extends"
},
{
"path": "src/Language/Node/EnumValueDefinitionNode.php",
"chars": 1286,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass EnumValueDefinitionNode exten"
},
{
"path": "src/Language/Node/EnumValueNode.php",
"chars": 786,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass EnumValueNode extends Abstrac"
},
{
"path": "src/Language/Node/EnumValuesTrait.php",
"chars": 841,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait EnumValuesTrait\n{\n /**\n * @var EnumValueDefinitionNode[]\n "
},
{
"path": "src/Language/Node/ExecutableDefinitionNodeInterface.php",
"chars": 312,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface ExecutableDefinitionNodeInterface extends DefinitionNodeInterfa"
},
{
"path": "src/Language/Node/FieldDefinitionNode.php",
"chars": 1677,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass FieldDefinitionNode extends A"
},
{
"path": "src/Language/Node/FieldNode.php",
"chars": 1694,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass FieldNode extends AbstractNod"
},
{
"path": "src/Language/Node/FieldsTrait.php",
"chars": 821,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait FieldsTrait\n{\n /**\n * @var FieldDefinitionNode[]\n */\n "
},
{
"path": "src/Language/Node/FloatValueNode.php",
"chars": 732,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass FloatValueNode extends Abstra"
},
{
"path": "src/Language/Node/FragmentDefinitionNode.php",
"chars": 1952,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass FragmentDefinitionNode extend"
},
{
"path": "src/Language/Node/FragmentNodeInterface.php",
"chars": 105,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface FragmentNodeInterface extends NodeInterface\n{\n}\n"
},
{
"path": "src/Language/Node/FragmentSpreadNode.php",
"chars": 1316,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass FragmentSpreadNode extends Ab"
},
{
"path": "src/Language/Node/InlineFragmentNode.php",
"chars": 1351,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InlineFragmentNode extends Ab"
},
{
"path": "src/Language/Node/InputArgumentsTrait.php",
"chars": 891,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait InputArgumentsTrait\n{\n /**\n * @var InputValueDefinitionNode["
},
{
"path": "src/Language/Node/InputFieldsTrait.php",
"chars": 846,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait InputFieldsTrait\n{\n /**\n * @var InputValueDefinitionNode[]\n "
},
{
"path": "src/Language/Node/InputObjectTypeDefinitionNode.php",
"chars": 1555,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InputObjectTypeDefinitionNode"
},
{
"path": "src/Language/Node/InputObjectTypeExtensionNode.php",
"chars": 1299,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InputObjectTypeExtensionNode "
},
{
"path": "src/Language/Node/InputValueDefinitionNode.php",
"chars": 1719,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InputValueDefinitionNode exte"
},
{
"path": "src/Language/Node/IntValueNode.php",
"chars": 728,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass IntValueNode extends Abstract"
},
{
"path": "src/Language/Node/InterfaceTypeDefinitionNode.php",
"chars": 1518,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InterfaceTypeDefinitionNode e"
},
{
"path": "src/Language/Node/InterfaceTypeExtensionNode.php",
"chars": 1230,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass InterfaceTypeExtensionNode ex"
},
{
"path": "src/Language/Node/InterfacesTrait.php",
"chars": 849,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait InterfacesTrait\n{\n /**\n * @var NamedTypeNode[]\n */\n p"
},
{
"path": "src/Language/Node/ListTypeNode.php",
"chars": 737,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ListTypeNode extends Abstract"
},
{
"path": "src/Language/Node/ListValueNode.php",
"chars": 1591,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ListValueNode extends Abstrac"
},
{
"path": "src/Language/Node/NameAwareInterface.php",
"chars": 537,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface NameAwareInterface\n{\n /**\n * @return NameNode|null\n "
},
{
"path": "src/Language/Node/NameNode.php",
"chars": 746,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass NameNode extends AbstractNode"
},
{
"path": "src/Language/Node/NameTrait.php",
"chars": 903,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait NameTrait\n{\n /**\n * @var NameNode|null\n */\n protected"
},
{
"path": "src/Language/Node/NamedTypeNode.php",
"chars": 746,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass NamedTypeNode extends Abstrac"
},
{
"path": "src/Language/Node/NamedTypeNodeInterface.php",
"chars": 329,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\n/**\n * Interface for named type nodes.\n */\ninterface NamedTypeNodeInterfa"
},
{
"path": "src/Language/Node/NodeInterface.php",
"chars": 1283,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\nuse Digia\\GraphQL\\Language\\Visitor\\V"
},
{
"path": "src/Language/Node/NodeKindEnum.php",
"chars": 3032,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nclass NodeKindEnum\n{\n\n // Name\n public const NAME = 'Name';\n\n //"
},
{
"path": "src/Language/Node/NonNullTypeNode.php",
"chars": 876,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass NonNullTypeNode extends Abstr"
},
{
"path": "src/Language/Node/NullValueNode.php",
"chars": 573,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass NullValueNode extends Abstrac"
},
{
"path": "src/Language/Node/ObjectFieldNode.php",
"chars": 928,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ObjectFieldNode extends Abstr"
},
{
"path": "src/Language/Node/ObjectTypeDefinitionNode.php",
"chars": 1707,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ObjectTypeDefinitionNode exte"
},
{
"path": "src/Language/Node/ObjectTypeExtensionNode.php",
"chars": 1455,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ObjectTypeExtensionNode exten"
},
{
"path": "src/Language/Node/ObjectValueNode.php",
"chars": 1268,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ObjectValueNode extends Abstr"
},
{
"path": "src/Language/Node/OperationDefinitionNode.php",
"chars": 2085,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass OperationDefinitionNode exten"
},
{
"path": "src/Language/Node/OperationTypeDefinitionNode.php",
"chars": 1142,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass OperationTypeDefinitionNode e"
},
{
"path": "src/Language/Node/ScalarTypeDefinitionNode.php",
"chars": 1293,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ScalarTypeDefinitionNode exte"
},
{
"path": "src/Language/Node/ScalarTypeExtensionNode.php",
"chars": 1036,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass ScalarTypeExtensionNode exten"
},
{
"path": "src/Language/Node/SchemaDefinitionNode.php",
"chars": 1812,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass SchemaDefinitionNode extends "
},
{
"path": "src/Language/Node/SchemaExtensionNode.php",
"chars": 1801,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass SchemaExtensionNode extends A"
},
{
"path": "src/Language/Node/SelectionNodeInterface.php",
"chars": 106,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface SelectionNodeInterface extends NodeInterface\n{\n}\n"
},
{
"path": "src/Language/Node/SelectionSetAwareInterface.php",
"chars": 281,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface SelectionSetAwareInterface\n{\n /**\n * @return bool\n *"
},
{
"path": "src/Language/Node/SelectionSetNode.php",
"chars": 1456,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass SelectionSetNode extends Abst"
},
{
"path": "src/Language/Node/SelectionSetTrait.php",
"chars": 877,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait SelectionSetTrait\n{\n\n /**\n * @var SelectionSetNode|null\n "
},
{
"path": "src/Language/Node/StringValueNode.php",
"chars": 1021,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass StringValueNode extends Abstr"
},
{
"path": "src/Language/Node/TypeConditionTrait.php",
"chars": 733,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait TypeConditionTrait\n{\n /**\n * @var NamedTypeNode|null\n */"
},
{
"path": "src/Language/Node/TypeNodeInterface.php",
"chars": 146,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\n/**\n * Tagging interface for Type nodes.\n */\ninterface TypeNodeInterface "
},
{
"path": "src/Language/Node/TypeSystemDefinitionNodeInterface.php",
"chars": 190,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\n/**\n * Tagging interface for Type System Definition nodes.\n */\ninterface "
},
{
"path": "src/Language/Node/TypeSystemExtensionNodeInterface.php",
"chars": 116,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface TypeSystemExtensionNodeInterface extends NodeInterface\n{\n}\n"
},
{
"path": "src/Language/Node/TypeTrait.php",
"chars": 555,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait TypeTrait\n{\n /**\n * @var TypeNodeInterface\n */\n prote"
},
{
"path": "src/Language/Node/TypesTrait.php",
"chars": 784,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait TypesTrait\n{\n /**\n * @var NamedTypeNode[]\n */\n protec"
},
{
"path": "src/Language/Node/UnionTypeDefinitionNode.php",
"chars": 1466,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass UnionTypeDefinitionNode exten"
},
{
"path": "src/Language/Node/UnionTypeExtensionNode.php",
"chars": 1189,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass UnionTypeExtensionNode extend"
},
{
"path": "src/Language/Node/ValueAwareInterface.php",
"chars": 155,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface ValueAwareInterface\n{\n /**\n * @return mixed|null\n */"
},
{
"path": "src/Language/Node/ValueLiteralTrait.php",
"chars": 628,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait ValueLiteralTrait\n{\n /**\n * @var ValueNodeInterface|null\n "
},
{
"path": "src/Language/Node/ValueNodeInterface.php",
"chars": 102,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface ValueNodeInterface extends NodeInterface\n{\n}\n"
},
{
"path": "src/Language/Node/ValueTrait.php",
"chars": 416,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait ValueTrait\n{\n /**\n * @var mixed|null\n */\n protected $"
},
{
"path": "src/Language/Node/VariableDefinitionNode.php",
"chars": 1624,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass VariableDefinitionNode extend"
},
{
"path": "src/Language/Node/VariableDefinitionsAwareInterface.php",
"chars": 204,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ninterface VariableDefinitionsAwareInterface\n{\n /**\n * @return Vari"
},
{
"path": "src/Language/Node/VariableDefinitionsTrait.php",
"chars": 853,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\ntrait VariableDefinitionsTrait\n{\n /**\n * @var VariableDefinitionNo"
},
{
"path": "src/Language/Node/VariableNode.php",
"chars": 691,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Node;\n\nuse Digia\\GraphQL\\Language\\Location;\n\nclass VariableNode extends Abstract"
},
{
"path": "src/Language/NodeBuilder.php",
"chars": 26619,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Language\\Node\\ArgumentNode;\nuse Digia\\GraphQL\\Language\\Node\\"
},
{
"path": "src/Language/NodeBuilderInterface.php",
"chars": 299,
"preview": "<?php\n\n// TODO: Move this file under the Node namespace\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Language\\N"
},
{
"path": "src/Language/NodePrinter.php",
"chars": 10758,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Language\\Node\\ArgumentNode;\nuse Digia\\GraphQL\\Language\\Node\\"
},
{
"path": "src/Language/NodePrinterInterface.php",
"chars": 303,
"preview": "<?php\n\n// TODO: Move this file under the Node namespace\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Language\\N"
},
{
"path": "src/Language/Parser.php",
"chars": 50567,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\nuse Digia\\GraphQL\\Language\\Node\\Ar"
},
{
"path": "src/Language/ParserInterface.php",
"chars": 3152,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Language\\Node\\DocumentNode;\n\n/**\n * Interface ParserInterfac"
},
{
"path": "src/Language/PrintException.php",
"chars": 137,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\AbstractException;\n\nclass PrintException extends Abstr"
},
{
"path": "src/Language/Source.php",
"chars": 2697,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\n\n/**\n * A representation of source"
},
{
"path": "src/Language/SourceBuilderInterface.php",
"chars": 234,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\n/**\n * Interface SourceBuilderInterface\n * @package Digia\\GraphQL\\Language\n */"
},
{
"path": "src/Language/SourceLocation.php",
"chars": 1585,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Util\\ArrayToJsonTrait;\nuse Digia\\GraphQL\\Util\\SerializationI"
},
{
"path": "src/Language/StringSourceBuilder.php",
"chars": 456,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nclass StringSourceBuilder implements SourceBuilderInterface\n{\n\n /**\n * "
},
{
"path": "src/Language/SyntaxErrorException.php",
"chars": 546,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\n\nclass SyntaxErrorException extends "
},
{
"path": "src/Language/Token.php",
"chars": 2972,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse Digia\\GraphQL\\Util\\ArrayToJsonTrait;\nuse Digia\\GraphQL\\Util\\SerializationI"
},
{
"path": "src/Language/TokenKindEnum.php",
"chars": 1130,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nclass TokenKindEnum\n{\n\n public const SOF = '<SOF>';\n public con"
},
{
"path": "src/Language/Visitor/ParallelVisitor.php",
"chars": 1852,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\n\nclass ParallelVisitor "
},
{
"path": "src/Language/Visitor/SpecificKindVisitor.php",
"chars": 22071,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\ArgumentNode;\nuse Digia\\GraphQL\\Langua"
},
{
"path": "src/Language/Visitor/TypeInfoVisitor.php",
"chars": 8503,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Util\\ConversionException;\nuse Digia\\GraphQL\\Error\\In"
},
{
"path": "src/Language/Visitor/Visitor.php",
"chars": 1147,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\n\nclass Visitor implemen"
},
{
"path": "src/Language/Visitor/VisitorBreak.php",
"chars": 93,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nclass VisitorBreak extends \\Exception\n{\n\n}\n"
},
{
"path": "src/Language/Visitor/VisitorInfo.php",
"chars": 2679,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\n\nclass VisitorInfo\n{\n "
},
{
"path": "src/Language/Visitor/VisitorInterface.php",
"chars": 422,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\n\ninterface VisitorInter"
},
{
"path": "src/Language/Visitor/VisitorResult.php",
"chars": 1117,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language\\Visitor;\n\nuse Digia\\GraphQL\\Language\\Node\\NodeInterface;\n\nclass VisitorResult\n{\n"
},
{
"path": "src/Language/blockStringValue.php",
"chars": 1763,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\n/**\n * Produces the value of a block string from its parsed raw value, similar"
},
{
"path": "src/Language/utils.php",
"chars": 4280,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Language;\n\nuse function Digia\\GraphQL\\Schema\\escapeQuotes;\n\n/**\n * @param int $code\n * @r"
},
{
"path": "src/Schema/Building/BuildInfo.php",
"chars": 3159,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\Grap"
},
{
"path": "src/Schema/Building/BuildingContext.php",
"chars": 3570,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\Grap"
},
{
"path": "src/Schema/Building/BuildingContextInterface.php",
"chars": 864,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Language\\Node\\SchemaDefinitionNode;\nuse Digia\\GraphQL"
},
{
"path": "src/Schema/Building/SchemaBuilder.php",
"chars": 5167,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\Grap"
},
{
"path": "src/Schema/Building/SchemaBuilderInterface.php",
"chars": 577,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Language\\Node\\DocumentNode;\nuse Digia\\GraphQL\\Schema\\"
},
{
"path": "src/Schema/Building/SchemaBuildingException.php",
"chars": 151,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\n\nclass SchemaBuildingExceptio"
},
{
"path": "src/Schema/Building/SchemaBuildingProvider.php",
"chars": 448,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Building;\n\nuse League\\Container\\ServiceProvider\\AbstractServiceProvider;\n\nclass Sc"
},
{
"path": "src/Schema/DefinitionBuilder.php",
"chars": 18911,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\nuse Digia\\GraphQL\\Error\\InvalidTypeException;\nuse Digia\\GraphQL\\Error\\InvariantE"
},
{
"path": "src/Schema/DefinitionBuilderInterface.php",
"chars": 1311,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\GraphQL\\Langu"
},
{
"path": "src/Schema/DefinitionInterface.php",
"chars": 161,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\n/**\n * Tagging interface for GraphQL definitions (schema, types, directive, etc."
},
{
"path": "src/Schema/DefinitionPrinter.php",
"chars": 17987,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\nuse Digia\\GraphQL\\Language\\PrintExce"
},
{
"path": "src/Schema/DefinitionPrinterInterface.php",
"chars": 1213,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\ninterface DefinitionPrinterInterface\n{\n /**\n * Prints a schema.\n *\n "
},
{
"path": "src/Schema/Extension/ExtendInfo.php",
"chars": 4104,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\Gra"
},
{
"path": "src/Schema/Extension/ExtensionContext.php",
"chars": 13760,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Error\\InvalidTypeException;\nuse Digia\\GraphQL\\Error\\"
},
{
"path": "src/Schema/Extension/ExtensionContextInterface.php",
"chars": 552,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Type\\Definition\\Directive;\nuse Digia\\GraphQL\\Type\\De"
},
{
"path": "src/Schema/Extension/SchemaExtender.php",
"chars": 8253,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Language\\Node\\DirectiveDefinitionNode;\nuse Digia\\Gra"
},
{
"path": "src/Schema/Extension/SchemaExtenderInterface.php",
"chars": 680,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Language\\Node\\DocumentNode;\nuse Digia\\GraphQL\\Schema"
},
{
"path": "src/Schema/Extension/SchemaExtensionException.php",
"chars": 153,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\n\nclass SchemaExtensionExcept"
},
{
"path": "src/Schema/Extension/SchemaExtensionProvider.php",
"chars": 453,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Extension;\n\nuse League\\Container\\ServiceProvider\\AbstractServiceProvider;\n\nclass S"
},
{
"path": "src/Schema/Resolver/AbstractFieldResolver.php",
"chars": 916,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nuse Digia\\GraphQL\\Execution\\ResolveInfo;\n\nabstract class AbstractFieldR"
},
{
"path": "src/Schema/Resolver/AbstractTypeResolver.php",
"chars": 710,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nabstract class AbstractTypeResolver implements ResolverCollectionInterf"
},
{
"path": "src/Schema/Resolver/ResolverCollectionInterface.php",
"chars": 257,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\ninterface ResolverCollectionInterface extends ResolverInterface\n{\n /"
},
{
"path": "src/Schema/Resolver/ResolverInterface.php",
"chars": 363,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\ninterface ResolverInterface\n{\n /**\n * @return callable|null\n "
},
{
"path": "src/Schema/Resolver/ResolverMap.php",
"chars": 1841,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nclass ResolverMap implements ResolverCollectionInterface\n{\n protecte"
},
{
"path": "src/Schema/Resolver/ResolverMiddlewareInterface.php",
"chars": 555,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nuse Digia\\GraphQL\\Execution\\ResolveInfo;\n\ninterface ResolverMiddlewareI"
},
{
"path": "src/Schema/Resolver/ResolverRegistry.php",
"chars": 3944,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nuse Digia\\GraphQL\\Execution\\ResolveInfo;\n\nclass ResolverRegistry implem"
},
{
"path": "src/Schema/Resolver/ResolverRegistryInterface.php",
"chars": 767,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\ninterface ResolverRegistryInterface\n{\n /**\n * @param string "
},
{
"path": "src/Schema/Resolver/ResolverTrait.php",
"chars": 890,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Resolver;\n\nuse Digia\\GraphQL\\Execution\\ResolveInfo;\n\ntrait ResolverTrait\n{\n /**"
},
{
"path": "src/Schema/Schema.php",
"chars": 11679,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\nuse Digia\\GraphQL\\Language\\Node\\ASTN"
},
{
"path": "src/Schema/Validation/Rule/AbstractRule.php",
"chars": 482,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\Schema\\Validation\\ValidationContextInterface;\n"
},
{
"path": "src/Schema/Validation/Rule/DirectivesRule.php",
"chars": 3964,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\nuse Digia\\GraphQL\\La"
},
{
"path": "src/Schema/Validation/Rule/RootTypesRule.php",
"chars": 1400,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\Schema\\Validation\\SchemaValidationException;\nu"
},
{
"path": "src/Schema/Validation/Rule/RuleInterface.php",
"chars": 367,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\Schema\\Validation\\ValidationContextInterface;\n"
},
{
"path": "src/Schema/Validation/Rule/SupportedRules.php",
"chars": 617,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\GraphQL;\n\nclass SupportedRules\n{\n /**\n "
},
{
"path": "src/Schema/Validation/Rule/TypesRule.php",
"chars": 26596,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation\\Rule;\n\nuse Digia\\GraphQL\\Error\\InvariantException;\nuse Digia\\GraphQL\\La"
},
{
"path": "src/Schema/Validation/SchemaValidationException.php",
"chars": 254,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation;\n\nuse Digia\\GraphQL\\Error\\GraphQLException;\nuse Digia\\GraphQL\\Validatio"
},
{
"path": "src/Schema/Validation/SchemaValidationProvider.php",
"chars": 949,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation;\n\nuse Digia\\GraphQL\\Schema\\Validation\\Rule\\DirectivesRule;\nuse Digia\\Gr"
},
{
"path": "src/Schema/Validation/SchemaValidator.php",
"chars": 967,
"preview": "<?php\n\nnamespace Digia\\GraphQL\\Schema\\Validation;\n\nuse Digia\\GraphQL\\Schema\\Schema;\nuse Digia\\GraphQL\\Schema\\Validation\\"
}
]
// ... and 214 more files (download for full content)
About this extraction
This page contains the full source code of the digiaonline/graphql-php GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 414 files (1.6 MB), approximately 378.7k tokens, and a symbol index with 2869 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.