GraphQL Flashcards

(20 cards)

1
Q

Define GraphQL.

A

A query language for APIs that allows clients to request specific data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or false: GraphQL uses a fixed structure for responses.

A

FALSE

The structure of responses in GraphQL is flexible and depends on the query.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does schema define in GraphQL?

A

It defines the types, queries, and mutations available in the API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: Resolvers are functions that resolve _______ in GraphQL.

A

data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a mutation in GraphQL?

A

A type of operation that modifies server-side data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define query in the context of GraphQL.

A

A request for data from the server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or false: GraphQL can only fetch data, not modify it.

A

FALSE

GraphQL supports both fetching and modifying data through queries and mutations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is introspection in GraphQL?

A

A feature that allows clients to query the schema for its types and fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fill in the blank: Fragments in GraphQL are used to share _______ across queries.

A

fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of variables in GraphQL queries?

A

To allow dynamic input values in queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define subscription in GraphQL.

A

A way to receive real-time updates from the server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True or false: GraphQL supports versioning of APIs.

A

FALSE

GraphQL encourages a single evolving version rather than multiple versions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a type in GraphQL?

A

A definition of a data structure in the schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Fill in the blank: Enums in GraphQL are used to define a set of _______.

A

allowed values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the role of directives in GraphQL?

A

To modify the behavior of queries and fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define Apollo Client.

A

A popular library for managing GraphQL data in client applications.

17
Q

True or false: GraphQL is primarily used with REST APIs.

A

FALSE

GraphQL is an alternative to REST APIs, not primarily used with them.

18
Q

What does N+1 problem refer to in GraphQL?

A

A performance issue where multiple database queries are made unnecessarily.

19
Q

Fill in the blank: Batching in GraphQL helps to reduce _______ calls.

20
Q

What is schema stitching in GraphQL?

A

A technique to combine multiple GraphQL schemas into one.