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

Include withCredentials config option to enable credentials in cross… #489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions docusaurus/docs/drivers/graphql-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ handleRequests({
});
```

To enable cross-site Access-Control requests to be made using credentials, `handleRequests` is configured as follows:

```js
import { handleRequests } from '@redux-requests/core';
import { createDriver } from '@redux-requests/graphql';

handleRequests({
driver: createDriver({
url: 'http://localhost:3000/graphql',
withCredentials: true
}),
});
```

In order to send a query, just do it in a similar fashion to other drivers. The only
one thing really specific to GraphQL is a way you define your actions. Let's create an action
to fetch books:
Expand Down
Loading