Skip to content
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

Add resolver argument annotation on parameterized field resolvers #1044

Merged

Conversation

clement-buchart
Copy link
Contributor

@clement-buchart clement-buchart commented Mar 13, 2023


Description

Currently, the resolver argument annotation is not applied on parameterized field resolver, which is problematic when using this generator to apply the org.springframework.graphql.data.method.annotation.Argument necessary to work with spring boot graphql integration.

This contains a commit that only adds a assertion file to demonstrate the issue, and another to fix it.


Changes were made to:

  • Codegen library - Java
  • Codegen library - Kotlin
  • Codegen library - Scala

@clement-buchart clement-buchart force-pushed the input-argument-annotation branch from 89488da to dae938a Compare March 13, 2023 17:04
@clement-buchart clement-buchart changed the base branch from master to develop March 13, 2023 17:04
@kobylynskyi kobylynskyi added this to the 5.7.0 milestone Mar 16, 2023
@clement-buchart clement-buchart force-pushed the input-argument-annotation branch from dae938a to 4d21ba1 Compare March 17, 2023 05:31
Signed-off-by: Clément BUCHART <clement@buchart.dev>
Signed-off-by: Clément BUCHART <clement@buchart.dev>
@clement-buchart clement-buchart force-pushed the input-argument-annotation branch from 4d21ba1 to bebdc29 Compare March 17, 2023 05:33
@kobylynskyi kobylynskyi merged commit 58f1061 into kobylynskyi:develop Mar 18, 2023
@kobylynskyi kobylynskyi mentioned this pull request Mar 19, 2023
@emaeuer
Copy link

emaeuer commented Mar 29, 2023

It works for me on the server side, but the client code isn't generated correctly (at least in combination with Spring GraphQL).

The problem is that the resolverArgumentAnnotations are also added to the fields of the corresponding implementation of GraphQLParametrizedInput. Therefore, the code can't be compiled because @org.springframework.graphql.data.method.annotation.Argument can only be added to parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants