gitwtfhub

graphql/graphql-spec

14,571JavaScriptAudience · developerComplexity · 4/5ActiveSetup · easy

TL;DR

Official GraphQL specification documents, written in Markdown, that define the query language, type system, validation, and execution rules used by every GraphQL implementation.

Mindmap

mindmap
  root((graphql-spec))
    Inputs
      Spec proposals
      Working group RFCs
      Edits to markdown
    Outputs
      Published spec HTML
      Tagged versions
      Reference rules
    Use Cases
      Build a GraphQL server
      Build a GraphQL client
      Author query tooling
    Tech Stack
      Markdown
      JavaScript
      GraphQLjs
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why anyone would actually build this

REASON 1

Implement a conforming GraphQL server in a new language

REASON 2

Audit an existing GraphQL library against the official rules

REASON 3

Author parsers, validators, or IDE tooling for GraphQL

REASON 4

Cite a specific tagged version of the spec in technical writing

Stack

MarkdownJavaScriptGraphQL

Spinning it up

Difficulty · easy Time to first run · 30min

It is a spec document, not runnable software, so the work is reading and interpreting Markdown rather than installing anything.

Wtf does this do

This repository is the home of the GraphQL specification, the document that defines exactly how the GraphQL query language should behave. GraphQL is a query language for APIs created at Facebook that lets a client ask for the precise pieces of data it needs from a backend service, rather than receiving a fixed response. The spec itself lives in markdown files under the spec folder, and the latest published version is hosted on graphql.github.io. The README is clear about who this repository is for. The target audience is not the average developer using GraphQL in an app, but people building GraphQL implementations and tools in different languages. The spec exists so all those implementations agree on the same rules, which is what allows GraphQL to be adopted across many backend environments. Most of the README is a walkthrough that introduces the core ideas of GraphQL through an example based on the original Star Wars trilogy. It starts by defining a type system, with types like Human and Droid that have fields such as name, id, and homePlanet. It then shows how to add enums, like the three Star Wars episodes, and how to share common fields through an interface called Character. The walkthrough explains nullability, marking a field as non-null with an exclamation mark, and introduces the special Query type that acts as the entry point a client uses to start asking questions. From there it covers the query language itself, how a server validates and executes those queries, and how clients can introspect a schema to discover what is available. Previous versions of the spec are kept at permalinks tied to release tags, and the project recommends linking to a specific tagged version when referencing GraphQL in other writing. The reference JavaScript implementation, GraphQL.js, lives in a sister repository and is used throughout the example code.

Yoink these prompts

Prompt 1
Summarize the difference between the October 2021 GraphQL spec and the current draft in this repo
Prompt 2
Show me where in the spec nullability and the non null exclamation mark are formally defined
Prompt 3
Help me write a conformance test that checks my server against the validation rules in this repo
Prompt 4
Explain the introspection chapter so I can build a schema explorer from it
View the repo → Decode another repo

← graphql on gitmyhub — every repo by this author, as a profile.

Don't trust strangers blindly. Verify against the repo.