"package" as a query parameter name #1306
Replies: 5 comments
-
Yes keywords are converted to _keyword in codegeneration. What is the error you are seeing? Is it that it is adding |
Beta Was this translation helpful? Give feedback.
-
Hey @srinivasankavitha - that's correct. When we actually set that parameter on the query, the name that's being used includes the underscore. As a result, the API complains because it doesn't recognize that parameter name. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, there isn't. The way you can work around is to just use a manual query string to pass in instead of the API builder generated by codegen. |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks. |
Beta Was this translation helpful? Give feedback.
-
The list of keywords comes from javax.lang.model.SourceVersion:
https://github.com/Netflix/dgs-codegen/blob/master/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/ReservedKeywordSanitizer.kt
…On Mon, Nov 7, 2022 at 9:38 AM terencemcdevitt-argondigital < ***@***.***> wrote:
Ok, thanks.
Do you have a list of the reserved words? I'm going to search the entire
schema we're working with to see if there are other places this is
happening.
—
Reply to this email directly, view it on GitHub
<#1306 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXMUDTAC3FLLV6BZQLTWHE5A7ANCNFSM6AAAAAARX7XHWI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
We're using DGS to build a Java client library that interfaces with a third party GraphQL API. In a number of query definitions in their schema, they're using "package" as the parameter name (I know... :( ).
It looks like DGS is converting this to "_package" - I assume because package is a reserved word in Java?
Anyway, when we use that param in our query builder then execute the query, the API complains because it doesn't know a param named "_package".
What options do we have here? We can't (easily) get the third party to change the param name.
Are we able to change the name of the parameter once it's been added to the query builder?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions