-
Notifications
You must be signed in to change notification settings - Fork 312
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 renaming fields without defining resolver or more than necessary complexity #636
Comments
Would my suggestion in discussion for #630 to implement general method call instrumentation address your issue? |
yes and i like your proposal, |
@nort3x is this a common prefix across your entities? How do you actually access the value, is there Generally, this sounds a lot like it's in the area of In any case, if you could elaborate on your use case for a start. |
This is the FetchSchemaDirectiveWiring that supported |
Some more background on the deprecation in graphql-java/graphql-java#2455. Seems related to avoiding an automatic schema traversal out of the box for every application irrespective of whether they need it or not. |
@rstoyanchev i faced this issue when i had an entity which holds request/response of some call as |
i also need to mention although |
@nort3x If I understand correctly, your use case involves a JPA entity with
I think the same argument could be made against using domain model classes as schema types and exposing them directly: we're tying our database schema to the public GraphQL schema. An update in the database schema might require adaptations to be still compatible with the GraphQL one. This conversation is not really specific to GraphQL support, we're seeing the same issues with REST services; except that in this case, Jackson annotations on domain classes won't have any effect as we're not using Jackson to produce the GraphQL response. Have you considered using Spring Data projections or an object mapping library? |
yes projection is directly addressing this issue, at first glance i thought having a more specialized way is convenient but many of this specialized make module very crowded and unpleasant, a more general way is always better. thanks for pointing me in right direction @bclozel , I'm closing this issue but anyone is welcomed to discuss this more if you find this approach unsatisfying. |
suppose that i have this setup:
i couldn't find a way to resolve
Entity.prefixedSomething
asEntity.something
beside explicitly adding another methodwith
@SchemaMapping(type="Entity", field="something")
which i think should be reserved for something more complicated than just a simple name override,
i couldn't find anything in docs, i'm looking for more compact way (possibly annotation based)
The text was updated successfully, but these errors were encountered: