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

Support Custom Type Configuration #1461

Open
MathieuLegault1 opened this issue Feb 26, 2024 · 0 comments
Open

Support Custom Type Configuration #1461

MathieuLegault1 opened this issue Feb 26, 2024 · 0 comments

Comments

@MathieuLegault1
Copy link

Is your feature request related to a problem? Please describe.
I'd like to implement what this library currently does with relayConfig but for any custom type. It's currently possible to tell the generator that a graphql type (e.g. UserConnection) should be defined as an hardcoded class with a generic. I would like this possible for any type since I want to use the TypeDefinitionConfigurer from spring-graphql (https://docs.spring.io/spring-graphql/docs/1.2.2/reference/html/#execution.pagination.types). graphql-java-tools has something similar too.

Describe the solution you'd like
My goal here would be to define something like this:
type Mutation { participateToQuiz(quizId: Int!): ParticipationPayload @payload(for: "Participation") }

Then in the plugin configuration:

{
  "graphqlResolverGenerics": {
    "@payload": "com.kobylynskyi.graphql.Payload<%s>"
  }
}

This would then define the following resolver interface:

com.kobylynskyi.graphql.Payload<Participation> participateToQuiz(Integer quizId) throws Exception;

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I haven't identified alternative solutions to achieve the desired functionality.

I'm more than happy to implement this feature myself and would appreciate feedback on its feasibility and acceptance.

Thanks !

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

No branches or pull requests

1 participant