You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this is conceptually a feature that makes a lot of sense, there is some difficulty in implementing this nicely.
The generated builder methods take the appropriate Java type as input. E.g. an Int input argument is represented by a builder method that takes an Integer.
I'm not sure how we would best represent a variable in such cases. For a String input it's easy to imagine simply setting the value to $someInputVar, but how would that work for other types?
FWIW, for these more complex queries, we've been recommending more and more to just specify them as a multi-line String in code, annotated with @Language("GraphQL"). The generation of query builders was introduced before multi-line Strings were available in Java, which made it ugly to specify queries as Strings. However, that's no longer an issue.
Of course this means there is no compile time checks on queries, but the compiler would never guarantee correctness in any case, because the "client schema" might be outdated. You need tests to verify if the queries actually work.
I have nothing to add, you said it all :)
We'll have to choose between benefiting from type checking at compile time and the performance offered by query caching.
Describe the Feature Request
Add support for specifying variables in client generation.
This is needed operation caching : for https://netflix.github.io/dgs/advanced/operation-caching/
Describe Alternatives
Workarrounds are
The text was updated successfully, but these errors were encountered: