-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
codegen not generating custom scalar types. #26
Comments
Thanks for your detailed bug report 👍 We don't have any test for scalar type definitions like you posted. It could very well be that this feature is missing. Do you have the time and interest to do a pull request 😎? I'll be more than happy to help you 🤗 |
Yes, scalar types are currently ignored. I don't remember how sangria represents it should be a matter of generating a type alias similar to how it is done for the built-in ID scalar type. |
@jonas is right. The type alias makes sense if it's actually only an alias. On the other hand there a some use cases for custom scalars, e.g. For custom scalar types we would need additional imports ( #29 ) as we cannot generate code for something we don't know ;) |
Yes, according to graphql docs:
The sad part here is as you pointed out already, there is no way to infer this serialisation just from the schema alone. I think your solution in #29 makes most sense. I could give implementing it a shot :). I'm closing this in favour of #29. |
Thanks a lot @anzecesar 😊 looking forward to a pull request. If you need any help, just open the pull request with the code you already have and we are more than happy to help 😊 |
Hi,
I might be missing something, but I have the following issue.
I'm fetching the schema from a remote server and trying to generate case classes for a query.
in my build.sbt I have:
This schema has some scalars defined
e.g.
which is then used in types
code generation works, but compilation fails.
In the generated code, it appears as:
which will fail at compilation step, because
JsonString
isn't defined:Interestingly,
ID
is defined astype ID = String
. I guess it's a built in GraphQL type, since I don't see it defined in the schema anywhere explicitly.I suspect the same might apply to enums defined in the schema.
The text was updated successfully, but these errors were encountered: