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

Support query code gen for scala.js client #22

Open
ngbinh opened this issue May 19, 2018 · 6 comments
Open

Support query code gen for scala.js client #22

ngbinh opened this issue May 19, 2018 · 6 comments

Comments

@ngbinh
Copy link
Contributor

ngbinh commented May 19, 2018

It would be great if we can do so. At the moment, I am not sure how to achieve that.

@muuki88
Copy link
Owner

muuki88 commented May 20, 2018

Thanks for your feature request 🤗

What do you exactly mean? The generated sources should work for the JVM and scala.js. A shared project could contain all queries, which can be reused on both sides.

The Apollo style generation generates self contained query/mutation objects, so you don't have to worry about any "how to get the query from source" issues 😎

@ngbinh
Copy link
Contributor Author

ngbinh commented May 20, 2018

Thanks for the quick reply,

For Apollo style, the generated code contains import sangria.macros._. I don't think sangria has published artifact for scala.js. https://mvnrepository.com/artifact/org.sangria-graphql/sangria

For Sangria code gen style, I believe I had some trouble with scalar type when the generated code doesn't seem to include the type so it could not be compiled.

@muuki88
Copy link
Owner

muuki88 commented May 20, 2018

For Apollo style, the generated code contains import sangria.macros._. I don't think sangria has published artifact for scala.js

Ah, true. We only need that for the document parsing. If we can make this configurable to only use a string, the it would work.

Maybe we can tweak the Apollo style in this direction.

@ngbinh
Copy link
Contributor Author

ngbinh commented May 20, 2018

For Sangria code gen with scalar type, I will try to use ScalarAlias to see if it work and report back here.

@ngbinh
Copy link
Contributor Author

ngbinh commented May 22, 2018

So 'ScalarAliasworks but notScalarType`.

@jonas
Copy link
Collaborator

jonas commented Jun 3, 2018

Thanks for the clarification.
The recent #26 is about the missing support for ScalarType

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

3 participants