-
-
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
Work #76 Fix union types for fragments #79
base: main
Are you sure you want to change the base?
Conversation
muuki88
commented
Nov 5, 2019
- write failing tests
- fix failing tests
Really appreciate for providing this great tool. Wonder what's the current status of this issue? I have been working on generating query models from a schema with union type Actor of two subtypes Human and Organization, but the generated code is complaining about missing encoder and failed the application at compile time, And, I was using CirceJsonCodeGen in my project, looks like the implementation of the encoder generation for union type is not there, wonder if this is intentional and if there are some alternatives to deal with union type query generation from schema? schemas I used
|
On the client-side The query example you posted would need a edit: I think this PR is only about unions in fragments. If you don't use fragments, it is probably already supported. |
Fragments are really really nasty and complex for this niche project 😓 However you can now override types and specify your own if the plugin does not generate proper code. |
I agree that such encoder for union type is not helpful, but in this case, the derived Encoder of Schedules requires an instance of the Actor encoder to be present to complete the encoder hierarchy, otherwise missing the instance triggers compile error The generated code.
This is the error I have after "sbt compile"
|
@muuki88 thanks for the suggestion, using my own type really solved the issue! |