-
Notifications
You must be signed in to change notification settings - Fork 100
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
bug: Kotlin Codegen fails to generate Code when field name package
is present
#641
Comments
Can you also please share your codegen settings? Also, it would be really helpful if you can move this issue to the our dgs-codegen repo: https://github.com/Netflix/dgs-codegen/issues |
Any maintainer who is a part of both projects shoul (theoretically) be able to move this issue between repos. Regarding codegen config, I was generating code for Kotlin with the client code, with basically all other settings in default mode |
Closing the issue in the framework since it's now in dgs-codegen |
Are you using the following settings?
I tried it with a sample schema like this and it compiles fine:
|
fyi. @mbossenbroek |
Confirmed this works with the kotlin2 stuff as well, and checked for a type named If that's not the case, could you provide a minimal GQL schema that repros? |
@srinivasankavitha @mbossenbroek with the code gen 6.2.1 And there are some schemas as `type Query { type Person { It will cause the exception. |
@zlishaojiez did you find any workaround for this? |
@mbossenbroek - could you take another look when you get a chance? |
My apologies - I saw the "with Java" in the last comment & thought it was for the other stuff. This PR should fix: #700 Also I added your repro case as a test case in there for it too. |
@mbossenbroek is the fix expected to be released core or the plugin itself? I am also getting this trying to generate a java client using the github schema same as @zlishaojiez. I am using the maven plugin
which is using core version 6.2.4. If it is an in plugin fix, I can take this over there. |
This fix was released a while ago. I'm not familiar with the maven plugin;
this was just a fix in the core codegen logic.
…On Wed, Aug 28, 2024 at 6:19 PM Ryan Rushton ***@***.***> wrote:
@mbossenbroek <https://github.com/mbossenbroek> is the fix expected to be
released?
I am also getting this trying to generate a java client using the github
schema same as @zlishaojiez <https://github.com/zlishaojiez>.
I am using the maven plugin
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.61.5</version>
which is using
<https://github.com/deweyjose/graphqlcodegen/blob/main/pom.xml#L38>
version 6.2.4.
—
Reply to this email directly, view it on GitHub
<#641 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPDI34E6BPTVVXZ7AXS5ODZTZZLLAVCNFSM6AAAAABBSEU276VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWGUZTMMBQGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Expected behavior
I was attempting to generate a client for the GitHub GraphQL API: https://docs.github.com/en/graphql/overview/public-schema
Unfortunately, it has a few fields name
package
and one type calledPackage
thus causing an exception to get thrown when the code is generatedActual behavior
Currently, the Gradle build fails with an error that
package
is an invalid nameSteps to reproduce
Note: A test case would be highly appreciated, but we understand that's not always possible
The text was updated successfully, but these errors were encountered: