Skip to content

Commit

Permalink
Renamed data loaders > loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
mishushakov committed Jun 10, 2023
1 parent 7af0b23 commit b8564e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineConfig({
{ text: 'Quickstart', link: '/docs/index.md' },
{ text: 'Schemas', link: '/docs/guide/schemas.md' },
{ text: 'Resolvers', link: '/docs/guide/resolvers.md' },
{ text: 'Data Loader', link: '/docs/guide/data-loader.md' },
{ text: 'Loaders', link: '/docs/guide/loaders.md' },
{ text: 'Inferring Types', link: '/docs/guide/inferring-types.md' },
{ text: 'Migrate <span class="badge-new">New</span>', link: '/docs/guide/migrate.md' }
]
Expand Down
6 changes: 3 additions & 3 deletions www/docs/guide/data-loader.md → www/docs/guide/loaders.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Data Loader
# Loaders

GraphQL Data Loaders are used to batch and load data from a data source. They help address the N+1 problem, which is a common performance issue in GraphQL APIs.
In GraphQL, Data Loaders are used to batch and load data from a data source. They help address the N+1 problem, which is a common performance issue in GraphQL APIs.

The N+1 problem occurs when a GraphQL query involves fetching a list of entities (e.g., users) along with a related field (e.g., their posts), and for each entity, an additional query is made to fetch the related data. This leads to multiple (database) queries, causing inefficiencies and potential performance bottlenecks.

In Garph, you can add a data loader to the field by making a field resolver return an object with `load` or `loadBatch` (no cache) function, which accepts a batch of queries that you can use to map to your data
In Garph, you can add loaders to fields by making a field resolver return an object with `load` or `loadBatch` (no cache) function, which accepts a batch of queries that you can use to map to your data

## Parameters

Expand Down

0 comments on commit b8564e2

Please sign in to comment.