GraphQL is a query language for APIs designed for highly dynamic queries that return small, targeted data instead of large amounts of unneeded data. Despite the “query” name, GraphQL has full CRUD support.

GraphQL is an open standard, not tied to any specific framework, though most cloud providers offer their own tools and extensions.

Learning Resources

Resolvers

Resolvers connect GraphQL queries to concrete data sources by translating query inputs into data source parameters and mapping outputs to GraphQL types.

Guidance

  • Avoid manually writing resolvers — most providers offer auto-generation
  • Avoid creating new types that only differ by a few fields; the overhead of managing many types is greater than writing clients that handle optional fields
  • Consider REST if inputs and outputs rarely change — REST APIs are usually easier to consume
  • Pairs well with NoSQL data sources that have variable/optional fields or evolving structure

Imported from shawn-notebook