Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in dataloader docs / improve grammatical consistency #7645

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/v11/fetching-data/dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A query against the above schema could look like the following:

The above request fetches two persons in one go without the need to call the backend twice. The problem with the GraphQL backend is that field resolvers are atomic and do not have any knowledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.

The idea of a dataloader is to batch these two requests into one call to the database.
The idea of a DataLoader is to batch these two requests into one call to the database.

Let's look at some code to understand what data loaders are doing. First, let's have a look at how we would write our field resolver without data loaders:

Expand Down Expand Up @@ -113,13 +113,13 @@ It executes resolvers until the queue is empty and then triggers the data loader

# Data Consistency

Dataloader do not only batch calls to the database, they also cache the database response.
Data loaders do not only batch calls to the database, they also cache the database response.
lemonez marked this conversation as resolved.
Show resolved Hide resolved
A data loader guarantees data consistency in a single request.
If you load an entity with a data loader in your request more than once, it is given that these two entities are equivalent.

Data loaders do not fetch an entity if there is already an entity with the requested key in the cache.

# Types of Data loaders
# Types of Data Loaders
lemonez marked this conversation as resolved.
Show resolved Hide resolved

In Hot Chocolate you can declare data loaders in two different ways.
You can separate the data loading concern into separate classes or you can use a delegate in the resolver to define data loaders on the fly.
Expand Down
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/v12/fetching-data/dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A query against the above schema could look like the following:

The above request fetches two persons in one go without the need to call the backend twice. The problem with the GraphQL backend is that field resolvers are atomic and do not have any knowledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.

The idea of a dataloader is to batch these two requests into one call to the database.
The idea of a DataLoader is to batch these two requests into one call to the database.

Let's look at some code to understand what data loaders are doing. First, let's have a look at how we would write our field resolver without data loaders:

Expand Down Expand Up @@ -113,13 +113,13 @@ It executes resolvers until the queue is empty and then triggers the data loader

# Data Consistency

Dataloader do not only batch calls to the database, they also cache the database response.
Data loaders do not only batch calls to the database, they also cache the database response.
lemonez marked this conversation as resolved.
Show resolved Hide resolved
A data loader guarantees data consistency in a single request.
If you load an entity with a data loader in your request more than once, it is given that these two entities are equivalent.

Data loaders do not fetch an entity if there is already an entity with the requested key in the cache.

# Types of Data loaders
# Types of Data Loaders

In Hot Chocolate you can declare data loaders in two different ways.
You can separate the data loading concern into separate classes or you can use a delegate in the resolver to define data loaders on the fly.
Expand Down
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/v13/fetching-data/dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A query against the above schema could look like the following:

The above request fetches two persons in one go without the need to call the backend twice. The problem with the GraphQL backend is that field resolvers are atomic and do not have any knowledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.

The idea of a dataloader is to batch these two requests into one call to the database.
The idea of a DataLoader is to batch these two requests into one call to the database.

Let's look at some code to understand what data loaders are doing. First, let's have a look at how we would write our field resolver without data loaders:

Expand Down Expand Up @@ -113,13 +113,13 @@ It executes resolvers until the queue is empty and then triggers the data loader

# Data Consistency

Dataloader do not only batch calls to the database, they also cache the database response.
Data loaders do not only batch calls to the database, they also cache the database response.
A data loader guarantees data consistency in a single request.
If you load an entity with a data loader in your request more than once, it is given that these two entities are equivalent.

Data loaders do not fetch an entity if there is already an entity with the requested key in the cache.

# Types of Data loaders
# Types of Data Loaders

In Hot Chocolate you can declare data loaders in two different ways.
You can separate the data loading concern into separate classes or you can use a delegate in the resolver to define data loaders on the fly.
Expand Down
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/v14/fetching-data/dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A query against the above schema could look like the following:

The above request fetches two persons in one go without the need to call the backend twice. The problem with the GraphQL backend is that field resolvers are atomic and do not have any knowledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.

The idea of a dataloader is to batch these two requests into one call to the database.
The idea of a DataLoader is to batch these two requests into one call to the database.

Let's look at some code to understand what data loaders are doing. First, let's have a look at how we would write our field resolver without data loaders:

Expand Down Expand Up @@ -113,13 +113,13 @@ It executes resolvers until the queue is empty and then triggers the data loader

# Data Consistency

Dataloader do not only batch calls to the database, they also cache the database response.
Data loaders do not only batch calls to the database, they also cache the database response.
A data loader guarantees data consistency in a single request.
If you load an entity with a data loader in your request more than once, it is given that these two entities are equivalent.

Data loaders do not fetch an entity if there is already an entity with the requested key in the cache.

# Types of Data loaders
# Types of Data Loaders

In Hot Chocolate you can declare data loaders in two different ways.
You can separate the data loading concern into separate classes or you can use a delegate in the resolver to define data loaders on the fly.
Expand Down