Skip to content
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

Generate code from schemas #19

Open
ksajme opened this issue Feb 23, 2018 · 2 comments
Open

Generate code from schemas #19

ksajme opened this issue Feb 23, 2018 · 2 comments

Comments

@ksajme
Copy link

ksajme commented Feb 23, 2018

It would be very useful to be able to leverage code generation to make case classes for a Sangria server with an SDL/IDL schema (within a .graphql file, Sangria calls this schema materialization).

Is that a feasible feature addition based on the code generation code being added to this project?

@muuki88
Copy link
Owner

muuki88 commented Feb 24, 2018

Hi @ksajme
Thanks for your suggestion. This sounds like a proper use case to me. Just to be clear that I don't get this wrong:

You have a pre-existing schema defined as SDL/IDL file.
Next you want to implement this schema. Normally you would have to implement the case classes your own, but you would like to generate them from the SDL.

I haven't looked at the schema materialisation feature in depth yet, but your suggestion sounds perfect for this plugin.

@ksajme
Copy link
Author

ksajme commented Feb 25, 2018

Yes, that's exactly it.

The use case is for GraphQL servers. Sangria provides macros to generate case classes if you are using its DSL but if you are using an SDL/IDL schema file as a source (materialization), you are out in the cold.

I'd be curious to see if the code @jonas is working on could be modified to fit this purpose without much fuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants