Recall & Review
beginner
What is a schema in GraphQL?
A schema in GraphQL defines the types of data you can query or mutate. It acts like a blueprint for what data is available and how clients can ask for it.
Click to reveal answer
beginner
What does the
type Query represent in a GraphQL schema?The
type Query defines the entry points for reading or fetching data. It lists all the queries clients can make to get data from the server.Click to reveal answer
intermediate
Explain the role of
type Mutation in a GraphQL schema.type Mutation defines the operations that change data, like creating, updating, or deleting. It tells clients how they can modify data on the server.Click to reveal answer
beginner
What is the purpose of
scalar types in GraphQL schema?Scalar types represent the basic data types like
Int, String, Boolean, Float, and ID. They are the building blocks for defining fields.Click to reveal answer
beginner
How do you define a custom object type in a GraphQL schema?
You define a custom object type using the
type keyword followed by the name and its fields with their types. For example:<br>type Book { id: ID! title: String! author: String }Click to reveal answer
What keyword starts the definition of a GraphQL schema's query type?
✗ Incorrect
The query type is defined using the keyword
type Query in GraphQL schema.Which GraphQL type is used to represent a unique identifier?
✗ Incorrect
The
ID scalar type is used to represent unique identifiers in GraphQL.What does the exclamation mark (!) mean in a GraphQL type definition like
String!?✗ Incorrect
The exclamation mark means the field is non-nullable, so it must always have a value.
Which part of the schema defines how to change data?
✗ Incorrect
type Mutation defines operations that modify data in GraphQL.How do you define a list of strings in GraphQL schema?
✗ Incorrect
Lists are defined using square brackets, like
[String] in GraphQL.Describe the main components of a GraphQL schema and their roles.
Think about how clients ask for data and how they change data.
You got /4 concepts.
Explain how you would define a new object type with fields in a GraphQL schema.
Imagine describing a real-world object like a book or user.
You got /4 concepts.