Intermediate Vocabulary #graphql #api #backend #schema

GraphQL Vocabulary

5 exercises — Query/Mutation/Subscription, the N+1 problem and DataLoader, non-null ! types, fragments vs inline fragments, and schema-first vs code-first design.

0 / 5 completed
GraphQL vocabulary quick reference
  • Query = read · Mutation = write · Subscription = real-time push via WebSocket
  • N+1 problem = 1 query + N resolver queries · DataLoader = batches + deduplicates per event loop tick
  • String! = non-null · String = nullable · [String!]! = non-null list of non-nulls
  • Fragment = named reusable field selection (...UserCard) · Inline fragment = ... on ConcreteType for unions/interfaces
  • Schema-first = write SDL then resolvers · Code-first = write code, SDL auto-generated (Pothos, TypeGraphQL)
1 / 5
A tech lead says: "This endpoint should be a Query, not a Mutation. And if you need live updates, that's a Subscription." When do you use each GraphQL operation type?