Use Generated Class in query.graphql #1265
Replies: 7 comments
-
|
Does your schema actually have a `Session` type defined?
…On Fri, Oct 7, 2022 at 1:36 PM Jaime Moncayo ***@***.***> wrote:
Hello - I'm trying to use a class that's imported from a dependency in my
query.graphql schema.
I've added
generateJava{
schemaPaths = ["${projectDir}/src/main/resources/graphql", "${projectDir}/src/main/resources/*"] // List of directories containing schema files
packageName = 'com.xyz.gen' // The package name to use to generate sources
generateClient = true // Enable generating the type safe query API
typeMapping = ["Session": "com.xyz.shared.xyz.xas.Session"] // Classes used during code generation.
}
Is there anything else I need to do? I keep getting this error
* The field type 'Session' is not present when resolving type 'Query' ***@***.***
<https://github.com/1>:1]
—
Reply to this email directly, view it on GitHub
<#1265>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXJNHUMAFXUO3CCLCDDWCCCUTANCNFSM6AAAAAAQ74ZN7Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I have a similar issue. Can you help me with this? I'm using kotlin and latest version 5.6.2 Thanks |
Beta Was this translation helpful? Give feedback.
-
|
You are running into this with Currency because codegen implicitly maps it
to the known Currency class. This can be overridden using the config for
type mapping, but you can't use a class that needs to be generated by the
same codegen plugin. I think we can remove the mapping in codegen here for
both java and kotlin, and that should be fine:
https://github.com/Netflix/dgs-codegen/blob/master/graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/TypeUtils.kt#L44
Feel free to open a PR if this is blocking you, else we will fix it in the
next release this week.
…On Tue, Nov 15, 2022 at 2:39 AM idiazvalenzuela ***@***.***> wrote:
I have a similar issue.
My schema has a Currency enum that the plugin wrongly resolves as
java.util.Currency.
If I add my Currency type to typeMapping, then my custom Currency.kt it's
not generated.
Can you help me with this? I'm using kotlin and latest version 5.6.2
Thanks
—
Reply to this email directly, view it on GitHub
<#1265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXNA7EEDMGDY6GKCWHTWINR7PANCNFSM6AAAAAAQ74ZN7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much for your help, here is the PR: Netflix/dgs-codegen#488 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks again for your help. |
Beta Was this translation helpful? Give feedback.
-
|
I'm planning to release today. |
Beta Was this translation helpful? Give feedback.
-
|
The latest release `v5.6.3` is now available
…On Mon, Nov 21, 2022 at 3:14 AM idiazvalenzuela ***@***.***> wrote:
Thanks again for your help.
Is it possible to get a released version that includes this? We are
currently blocked, so we will be really grateful if there's a release that
includes this.
—
Reply to this email directly, view it on GitHub
<#1265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXLNZPPWZXI2NICETNTWJNKQRANCNFSM6AAAAAAQ74ZN7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello - I'm trying to use a class that's imported from a dependency in my query.graphql schema.
I've added the type mapping in my gradle file
Is there anything else I need to do? I keep getting this error
* The field type 'Session' is not present when resolving type 'Query' [@1:1]
Beta Was this translation helpful? Give feedback.
All reactions