GraphQL schemas, types, queries, mutations, subscriptions, resolvers, N+1 problem and comparison with REST.
34 cards · basic cards · AI-written, checked twice. Edit anything.
- What is GraphQL?
Show answer
A query language and runtime for APIs that allows clients to request exactly the data they need
- What is a GraphQL schema?
Show answer
A type system that defines all possible data types, queries, mutations, and subscriptions a GraphQL API can handle
- What is SDL in GraphQL?
Show answer
Schema Definition Language, a human-readable syntax for defining a GraphQL schema
- What are the built-in scalar types in GraphQL?
Show answer
String, Int, Float, Boolean, and ID
- What is an Object type in GraphQL?
Show answer
A type that represents a complex object with named fields, each of which has its own type
- What is an Interface in GraphQL?
Show answer
A template that defines a set of fields that multiple object types can implement
- What is a Union type in GraphQL?
Show answer
A type that represents an object that could be one of several different object types
- What is an Enum type in GraphQL?
Show answer
A scalar type that represents a fixed set of allowed string values
- What is an Input type in GraphQL?
Show answer
A type used as an argument to queries or mutations to pass structured input data
- What does the exclamation mark mean in a GraphQL type definition?
Show answer
The field is non-nullable (required), meaning it will never return null
- What does [Type] represent in GraphQL?
Show answer
A list of that type, where the bracketed type can appear zero or more times in the result
- What is a GraphQL query?
Show answer
A request for data from a GraphQL server that specifies exactly which fields to retrieve
- What is the Query root type in GraphQL?
Show answer
The entry point that defines all top-level queries available in a GraphQL API
- What is a resolver in GraphQL?
Show answer
A function that returns the data for a field, either from a database, cache, or another source
- What are the standard parameters of a resolver function?
Show answer
The parent object, field arguments, context object, and info about the query