GraphQL: From Facebook's 2012 Internal Fix to an API Standard

Why letting clients shape their own queries changed how modern APIs are designed

Fun fact

GraphQL was born at Facebook in 2012, where mobile engineers fought REST endpoints that forced the app to download far more data than a screen needed - or demanded several round-trips to assemble one view. The answer was radical: let the client describe the exact shape of the data, and the server returns exactly that, nothing more. Facebook open-sourced the specification in 2015, and in 2018 stewardship moved to the newly created GraphQL Foundation under the Linux Foundation. The Schema Definition Language officially joined the specification on February 9, 2018. Today GitHub, Shopify and Yelp all expose public GraphQL APIs. One elegant detail: every field is nullable by default, and a single exclamation mark is all it takes to make one required.

Tool usage guide

  1. Paste your GraphQL query into the editor - the formatter straightens out messy indentation automatically.
  2. Load a schema in SDL format and explore its types, fields and relations in the visualizer.
  3. Assemble or edit the query by picking fields; the builder keeps the syntax valid as you go.
  4. Copy the finished query, run it against your endpoint, or share it with the team.

Try the tool

GraphQL Explorer →

Further reading

GraphQL on Wikipedia — Wikipedia article