Skip to content

Instantly share code, notes, and snippets.

@KieronWiltshire
Created July 18, 2017 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KieronWiltshire/052e7ec8b359235432c834bc592b757e to your computer and use it in GitHub Desktop.
Save KieronWiltshire/052e7ec8b359235432c834bc592b757e to your computer and use it in GitHub Desktop.

So basically, GraphQL's main principle is that in theory, it should allow you to make 1 single call to the web service, and retrieve as much data as you may possibly need. An example below:

http://somedomain.com/graphql?query={ user, posts }

The call above would retrieve all of the users and all of the posts.

Now my issue is that, if I namespace everything on routes like so:

http://somedomain.com/graphql/PostPlugin?query={ posts }
http://somedomain.com/graphql/UserPlugin?query={ user }

I'm now making multiple calls in order to retrieve my data, which is exactly the opposite of what GraphQL was designed to for. So yes it now becomes possible, but is it justifyable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment