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

Consider separating out GraphQL parsing #2

Closed
devknoll opened this issue Apr 23, 2015 · 5 comments
Closed

Consider separating out GraphQL parsing #2

devknoll opened this issue Apr 23, 2015 · 5 comments

Comments

@devknoll
Copy link
Contributor

Facebook's implementation actually compiles GraphQL to an AST on the client side. This seems to be a prerequisite for Relay to work (maybe @leebyron or @schrockn can comment on this).

I propose that graphql-ruby starts moving in that direction. Instead of parsing GraphQL, the interface would accept and process a JSON AST. On the client side, you could use something like https://github.com/ooflorent/graphql-parser (or the Facebook reference implementation when it's released).

This would free graphql-ruby from worrying about parsing the query and handling variables. Everything would just come in the JSON AST. You could also fall back to processing a full query (for non-JS clients) using something like therubyracer.

I'm happy to work on this, but I'd like to hear your thoughts.

@devknoll
Copy link
Contributor Author

Closing because @josephsavona proved me wrong 😄

@rmosolgo
Copy link
Owner

Cool, thanks for checking it out anyways. Seems like its hard to do too much more til we get a proper spec etc!

@devknoll
Copy link
Contributor Author

Have you done anything about schema descriptions yet? Facebook's definitions look like https://twitter.com/schrockn/status/567902849272659968/photo/1

@rmosolgo
Copy link
Owner

Support here is pretty half-hearted (and not documented) but I plan to "get on their level" and require descriptions at build time!

@rmosolgo
Copy link
Owner

rmosolgo commented May 4, 2015

@devknoll I made node descriptions required here dbf4988 and I'm thinking a bit about the field description API here #3

I'm not feeling great about that field description API though, it feels long-winded!

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