question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add DataFetchingEnvironment parameter to main query resolver

See original GitHub issue

Is your feature request related to a problem? Please describe. When using GraphQL Java Tools, the main Query resolver, like other resolvers, can take an optional DataFetchingEnvironment parameter. It is currently generated in all resolvers interfaces, but not for the root resolvers like Query.

Describe the solution you’d like It’d be nice to provide this DataFetchingEnvironment argument to the query resolver’s methods. If we need backwards compatibility, we could use a config parameter to add or not the DataFetchingEnvironment argument in the generated interfaces.

Describe alternatives you’ve considered There is no other way currently than to stop implementing the Query interface, which is a pain because changes to the schema don’t make the compilation fail.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
joffrey-bioncommented, Apr 9, 2020

Yes, I’ll try to work on it tomorrow

1reaction
joffrey-bioncommented, Apr 9, 2020

By automatically I meant that if the code is not duplicated, adding the DataFetchingEnvironment in one place solves the other one.

On Thu, Apr 9, 2020, 17:27 Bogdan Kobylynskyi notifications@github.com wrote:

Yes, we could definitely make the unification. Thanks for finding this. But how will this automatically solve the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kobylynskyi/graphql-java-codegen/issues/61#issuecomment-611590797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOTDUBTEGS355D2JUHUO7TRLXSPLANCNFSM4MEEEM3Q .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass Params from GraphQLQueryResolver to ... - GitHub
I tried: Adding the Locale parameter to the CategoryResolver.products() function, but that does not compile; Adding the DataFetchingEnvironment ...
Read more >
Spring Boot GraphQL Tutorial #14 - DataFetchingEnvironment
Every resolver is passed a DataFetchingEnvironment object which allows it to know more about what is being fetched and what arguments have ...
Read more >
getting requested fields on resolver level from graphql
You can add the dataFetchingEnvironment as a parameter and get the list of requested field names using that. public BookTO bookById(String ...
Read more >
Nested Resolvers and Shared Arguments | GraphQL Kotlin
You can add the DataFetchingEnvironment as an argument. This class will be ignored by the schema generator and will allow you to view...
Read more >
Data fetching - DGS Framework - Netflix Open Source
You can get input arguments as method arguments in a datafetcher method using the @InputArgument annotation. type Query { shows(title: String, filter: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found