GraphQL Distributed Systems

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/44

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:15 PM on 2/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

45 Terms

1
New cards

What problem does GraphQL address compared to REST?

Over-fetching, under-fetching, and complex client-side orchestration across multiple endpoints.

2
New cards

When should query-driven APIs be preferred?

When clients need flexible data shapes and aggregation across multiple resources.

3
New cards

How does a GraphQL response relate to its request?

The response shape mirrors the query exactly.

4
New cards

What is introspection in GraphQL?

The ability to query the schema itself to discover types, fields, and capabilities.

5
New cards

What is a selection set in GraphQL?

The set of fields a client explicitly requests for a type.

6
New cards

Why are selection sets important?

They ensure clients receive exactly the data they need—no more, no less.

7
New cards

How does GraphQL handle relationships between entities?

By allowing natural traversal across related fields in a single query.

8
New cards

What are arguments in GraphQL?

Typed inputs used to filter or parameterize fields.

9
New cards

Why use variables in GraphQL queries?

To make queries reusable and separate query structure from values.

10
New cards

Why should pagination be applied early in GraphQL queries?

To bound execution cost and prevent unbounded result sets.

11
New cards

What is a fragment in GraphQL?

A reusable selection of fields that can be included in multiple queries.

<p>A reusable selection of fields that can be included in multiple queries.</p>
12
New cards

Why are fragments useful?

They reduce duplication and keep response shapes consistent.

13
New cards

What are directives in GraphQL?

Annotations like @include and @skip that conditionally include fields.

<p>Annotations like @include and @skip that conditionally include fields.</p>
14
New cards

What are aliases used for in GraphQL?

To rename fields in the response without changing the schema.

15
New cards

What is the GraphQL schema?

A strongly typed contract that defines types, fields, and relationships.

16
New cards

What does the non-null operator (!) mean?

The field must always return a value and can never be null.

17
New cards

How are relationships modeled in GraphQL schemas?

As fields on object types, not as URLs.

18
New cards

SDL Meaning

Schema Definition Language

<p>Schema Definition Language</p>
19
New cards

What are GraphQL mutations used for?

To change server-side state.

20
New cards

How do GraphQL mutations differ from REST writes?

The client controls exactly which fields are returned after the mutation.

<p>The client controls exactly which fields are returned after the mutation.</p>
21
New cards

Why are mutations useful for optimistic UI updates?

Because the response shape can immediately update the client state.

22
New cards

What are GraphQL subscriptions?

Long-lived operations for real-time data streams, usually over WebSockets.

<p>Long-lived operations for real-time data streams, usually over WebSockets.</p>
23
New cards

When should subscriptions be used?

For live updates such as dashboards or activity feeds.

24
New cards

What must be considered when using subscriptions?

Filtering early, applying backpressure, and limiting resource usage.

25
New cards

How does GraphQL structure responses?

A top-level data object, optionally combined with an errors array.

26
New cards

What does partial success mean in GraphQL?

Some fields resolve successfully while others return errors.

27
New cards

Why is partial data important in distributed systems?

Because failures are common and should not break the entire response.

28
New cards

What pagination strategies exist in GraphQL?

Offset/limit and cursor-based pagination.

<p>Offset/limit and cursor-based pagination.</p>
29
New cards

Why is cursor-based pagination preferred?

It provides stable ordering and avoids inconsistencies when data changes.

30
New cards

What is the N+1 problem in GraphQL?

Executing one query for a list and one additional query per item.

31
New cards

How can the N+1 problem be mitigated?

By batching requests and caching per request (e.g., DataLoader).

32
New cards

Why is field-level tracing important?

To identify slow resolvers and performance bottlenecks.

33
New cards

What are persisted queries?

Pre-registered queries identified by stable hashes.

<p>Pre-registered queries identified by stable hashes.</p>
34
New cards

Why use persisted queries?

They improve caching, reduce payload size, and limit attack surface.

35
New cards

Where can caching be applied in GraphQL?

On the client, at the edge, and inside resolvers.

36
New cards

How is authentication typically handled in GraphQL?

Via headers or tokens injected into the request context.

37
New cards

Why enforce depth and complexity limits?

To protect against expensive or abusive queries.

38
New cards

What is the principle of least privilege in GraphQL?

Each field should only expose the minimum required data.

39
New cards

What are the core types in the Task Manager example?

Project and Task.

40
New cards

What operations are demonstrated in the running case?

Queries, mutations, and subscriptions.

41
New cards

Why is the running case useful?

It shows end-to-end GraphQL usage in a realistic scenario.

42
New cards

What should be logged in GraphQL systems?

Operation name or hash, duration, errors, and resolver metrics.

43
New cards

How should GraphQL schemas evolve safely?

Through additive changes, deprecations, and clear sunset policies.

44
New cards

Why is the schema considered a long-term contract?

Because clients depend on it directly.

45
New cards

What types of tests are used in GraphQL applications?

  • Contract tests, Resolver/ unit tests, Integration tests

<ul><li><p>Contract tests, Resolver/ unit tests, Integration tests </p></li></ul><p></p>