Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/api/link/apollo-link-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Easily set a context on your operation, which is used by other link

## Overview

The `setContext` function accepts a function that returns either an object or a promise, which then returns an object to set the new context of a request. It receives two arguments: the GraphQL request being executed, and the previous context. This link makes it easy to perform the asynchronous lookup of things like authentication tokens and more.
The `setContext` function accepts a function that returns either an object or a promise, which then returns an object to be merged with the context of a request. It receives two arguments: the GraphQL request being executed, and the previous context. This link makes it easy to perform the asynchronous lookup of things like authentication tokens and more.

```js
import { setContext } from "@apollo/client/link/context";
Expand Down