Comments (2)
I have found eventually that I can make this code work by adding the following code:
--- gqltest.php 2020-01-18 20:47:56.050542861 +1300
+++ gqltest2.php 2020-01-18 20:47:43.210501306 +1300
@@ -28,6 +28,11 @@
];
},
],
+ 'NamedNode' => [
+ '__resolveType' => function($item) {
+ return 'Test';
+ },
+ ],
]);
$result = graphql($schema, $queryText);
I would suggest, then, that perhaps the error message, or else the documentation, is the real problem here. I was unable to find a reference to __resolveType
in the documentation, but found this code in the test suite.
from graphql-php.
I've dumped the stack trace out from within graphql-php
code, to try to resolve this issue.
-- Call to a member function getName() on null
#0 /var/www/html/vendor/digiaonline/graphql/src/Execution/Strategy/AbstractExecutionStrategy.php(764): Digia\GraphQL\Execution\Strategy\AbstractExecutionStrategy->buildLocatedError(Object(Error), Array, Array)
#1 /var/www/html/vendor/digiaonline/graphql/src/Execution/Strategy/AbstractExecutionStrategy.php(345): Digia\GraphQL\Execution\Strategy\AbstractExecutionStrategy->handleFieldError(Object(Error), Array, Array, Object(Digia\GraphQL\Type\Definition\InterfaceType))
#2 /var/www/html/vendor/digiaonline/graphql/src/Execution/Strategy/AbstractExecutionStrategy.php(219): Digia\GraphQL\Execution\Strategy\AbstractExecutionStrategy->completeValueCatchingError(Object(Digia\GraphQL\Type\Definition\InterfaceType), Array, Object(Digia\GraphQL\Execution\ResolveInfo), Array, Array)
#3 /var/www/html/vendor/digiaonline/graphql/src/Execution/Strategy/ParallelExecutionStrategy.php(34): Digia\GraphQL\Execution\Strategy\AbstractExecutionStrategy->resolveField(Object(Digia\GraphQL\Type\Definition\ObjectType), NULL, Array, Array)
#4 /var/www/html/vendor/digiaonline/graphql/src/Execution/Strategy/AbstractExecutionStrategy.php(125): Digia\GraphQL\Execution\Strategy\ParallelExecutionStrategy->executeFields(Object(Digia\GraphQL\Type\Definition\ObjectType), NULL, Array, Array)
#5 /var/www/html/vendor/digiaonline/graphql/src/Execution/Execution.php(90): Digia\GraphQL\Execution\Strategy\AbstractExecutionStrategy->execute()
#6 /var/www/html/vendor/digiaonline/graphql/src/Execution/Execution.php(53): Digia\GraphQL\Execution\Execution->executeOperation(NULL, Object(Digia\GraphQL\Execution\ExecutionContext), Object(Digia\GraphQL\Execution\Strategy\FieldCollector), Object(Digia\GraphQL\Execution\ValuesResolver))
#7 /var/www/html/vendor/digiaonline/graphql/src/GraphQL.php(266): Digia\GraphQL\Execution\Execution->execute(Object(Digia\GraphQL\Schema\Schema), Object(Digia\GraphQL\Language\Node\DocumentNode), NULL, NULL, Array, NULL, NULL, NULL)
#8 /var/www/html/vendor/digiaonline/graphql/src/api.php(151): Digia\GraphQL\GraphQL::execute(Object(Digia\GraphQL\Schema\Schema), Object(Digia\GraphQL\Language\Node\DocumentNode), NULL, NULL, Array, NULL, NULL, NULL)
#9 /var/www/html/vendor/digiaonline/graphql/src/GraphQL.php(335): Digia\GraphQL\execute(Object(Digia\GraphQL\Schema\Schema), Object(Digia\GraphQL\Language\Node\DocumentNode), NULL, NULL, Array, NULL, NULL, NULL)
#10 /var/www/html/vendor/digiaonline/graphql/src/api.php(199): Digia\GraphQL\GraphQL::process(Object(Digia\GraphQL\Schema\Schema), '{\n test {\n ...', NULL, NULL, Array, NULL, NULL, NULL)
#11 /var/www/html/gqltest.php(33): Digia\GraphQL\graphql(Object(Digia\GraphQL\Schema\Schema), '{\n test {\n ...')
#12 {main}⏎
from graphql-php.
Related Issues (20)
- Laravel integration package HOT 2
- How to resolve inner type field defined in graphql language HOT 5
- Improving Performances HOT 12
- Wrong type-hints for errors in ExecutionResult
- Split buildSchema() into buildDocument() and buildSchema() (or similar) HOT 1
- Don't validate the schema again when validating the query against it
- Add a CHANGELOG
- Reduce redundant container calls while executing
- Exceptions can sometimes be wrapped inside two ExecutionExceptions HOT 2
- Deferred resolving doesn't seem to work HOT 15
- Misuse of Middleware HOT 3
- [Question] How to get requested fields inside resolver function? HOT 2
- `extend` doesn't work HOT 2
- Skipping schema validation greatly speeds up the execution HOT 1
- Error Reporting HOT 2
- [Question]: Question about an request
- How would I return a list of objects with total records HOT 1
- error with php 8.1 HOT 1
- ⚠️ Advance notice: this project will be archived ⚠️
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-php.