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

#33 - Macro for parsing graphql documents at compile time #56

Merged
merged 3 commits into from
Aug 23, 2015

Conversation

dlreeves
Copy link
Contributor

This addresses issue #33 by adding a LiteralGraphQLStringContext that adds a graphql method. This allows you to use string interpolation to parse a string literal into a sangria.ast.Document. This is done via a simple macro that calls QueryParse.parse on the string literal pulled from the StringContext call.

The majority of the code is in implementing the Liftable type class for all the ASTNodes. This requires quite a bit of boilerplate, but should be fine for now. Perhaps there is something available that implements this type class automatically for case classes?

This macro allows us to parse the string literal at compile time. Compilation will fail if the string cannot be parsed.

…ingContext that adds a graphql method. This allows you to use string interpolation to parse a string literal into a sangria.ast.Document. This is done via a simple macro that calls QueryParse.parse on the string literal pulled from the StringContext call.

The majority of the code is in implementing the Liftable type class for all the ASTNodes. This requires quite a bit of boilerplate, but should be fine for now. Perhaps there is something available that implements this type class automatically for case classes?

This macro allows us to parse the string literal at compile time. Compilation will fail if the string cannot be parsed.
This addresses issue sangria-graphql#33 by adding a LiteralGraphQLStringContext  that adds a graphql method. This allows you to use string interpolation to parse a string literal into a sangria.ast.Document. This is done via a simple macro that calls QueryParse.parse on the string literal pulled from the StringContext call.

The majority of the code is in implementing the Liftable type class for all the ASTNodes. This requires quite a bit of boilerplate, but should be fine for now. Perhaps there is something available that implements this type class automatically for case classes?

This macro allows us to parse the string literal at compile time. Compilation will fail if the string cannot be parsed.
@OlegIlyenko
Copy link
Member

Looks great, thanks a lot! Sorry for this failing coveralls check, I haven't configured it properly yet.

OlegIlyenko added a commit that referenced this pull request Aug 23, 2015
#33 - Macro for parsing graphql documents at compile time
@OlegIlyenko OlegIlyenko merged commit 28e2287 into sangria-graphql:master Aug 23, 2015
khoberg pushed a commit to khoberg/sangria that referenced this pull request Apr 16, 2020
…graph-4.8.69

Update classgraph to 4.8.69
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

Successfully merging this pull request may close these issues.

None yet

2 participants