-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide consistent support for dynamically registered DataFetchers #1770
Conversation
Implemented a new way of using `@DgsCodeRegistry` in which a `DgsCodeRegistryBuilder` is injected instead. This way, the registered DataFetchers are processed by DataFetcherResultProcessors and the behaviour is more consistent with the annotation-based approach. [Link to discussion](Netflix#1768)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR contribution. Changes look good, just had a few comments.
graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/DgsSchemaProvider.kt
Outdated
Show resolved
Hide resolved
@@ -477,29 +481,66 @@ internal class DgsSchemaProviderTest { | |||
val coordinates = FieldCoordinates.coordinates("Query", "myField") | |||
return codeRegistryBuilder.dataFetcher(coordinates, df) | |||
} | |||
|
|||
// Result should be processed by DataFetcherResultProcessors | |||
@DgsCodeRegistry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to also update our docs to use the DgsCodeRegistryBuilder? Much appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, where are the docs 😄 ?
graphql-dgs/src/main/java/com/netflix/graphql/dgs/DgsCodeRegistryBuilder.java
Outdated
Show resolved
Hide resolved
I was looking at the code today in I won't have time to make this change in the next 2-3 days, but will most likely get to it in the weekend |
Ok. I don't mind the current solution in any case. It's really not much duplication. |
Ok, if I'm gonna make more changes better make them in pieces. For this commit, I propose we just handle this. |
Sounds good. @kilink - any objections to merging this PR? |
graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/DgsCodeRegistryBuilder.kt
Outdated
Show resolved
Hide resolved
graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/DgsCodeRegistryBuilder.kt
Outdated
Show resolved
Hide resolved
LGTM, just had 2 minor comments about nullability of parameters. |
Thanks, I updated the PR with the suggested changes. I haven't received an answer to this question though |
Think we decided to keep things as is for now. We can do a refactor in a separate PR in the future, but I'm also fine leaving things the way they are for now. The branch has some conflicts. If you could resolve them when you have a chance, we'll go ahead and merge the PR. Thanks for all the work on the PR! |
Pull request checklist
first
Pull Request type
Changes in this PR
Implemented a new way of using
@DgsCodeRegistry
in which aDgsCodeRegistryBuilder
is injected instead. This way, the registered DataFetchers are processed by DataFetcherResultProcessors and the behavior is more consistent with the annotation-based approach.Link to discussion
Alternatives considered
Haven't considered alternatives.