graphql-java / graphql-java/graphql-java
`LightDataFetcher` implementation not getting executed as intended
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 1.1k
- Avg merge
- 22m
- Merged PRs (30d)
- 14
Description
Describe the bug
This condition in ExecutionStrategy:invokeDataFetcher():
if (dataFetcher instanceof LightDataFetcher) {
is evaluating to False even if the dataFetcher is actually created by implementing LightDataFetcher interface.
I have tried to debug why it is so, and I found this object being passed as datafetcher to the invokeDataFetcher function which is being evaluated as not a LightDataFetcher:
Context
I am creating a LightOperationExecutor as a lightweight alternative to OperationExecutor in GraphQL-SPQR by implementing LightDataFetcher. Open PR #502
To Reproduce
To reproduce, checkout commit 05642488bc and run test in Maven. You should see the tests SchemaTest.testSchema and RelayTest.testRelayMutations produce errors.
Note that even though the commit uses GraphQL-Java 21.3, this is also reproducible on 22.1 (latest), however in this situation we have this datafetcher object,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/graphql/execution/ExecutionStrategy.java at invokeDataFetcher(), focusing on the LightDataFetcher condition and the object passed there. Reproduce the report by checking out commit 05642488bc and running Maven tests, especially SchemaTest.testSchema and RelayTest.testRelayMutations. Done means the reported LightDataFetcher implementation is handled as intended and those tests no longer produce the described errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100