{"action":"opened","issue":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/2","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/2/comments","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/2/events","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/2","id":70276935,"number":2,"title":"Consider separating out GraphQL parsing","user":{"login":"devknoll","id":1477230,"avatar_url":"https://avatars.githubusercontent.com/u/1477230?v=3","gravatar_id":"","url":"https://api.github.com/users/devknoll","html_url":"https://github.com/devknoll","followers_url":"https://api.github.com/users/devknoll/followers","following_url":"https://api.github.com/users/devknoll/following{/other_user}","gists_url":"https://api.github.com/users/devknoll/gists{/gist_id}","starred_url":"https://api.github.com/users/devknoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devknoll/subscriptions","organizations_url":"https://api.github.com/users/devknoll/orgs","repos_url":"https://api.github.com/users/devknoll/repos","events_url":"https://api.github.com/users/devknoll/events{/privacy}","received_events_url":"https://api.github.com/users/devknoll/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T01:31:45Z","updated_at":"2015-04-23T01:31:45Z","closed_at":null,"body":"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).\r\n\r\nI 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).\r\n\r\nThis 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."}}