Skip to content

Commit

Permalink
docs(remote-schema): adjust Fetcher interface
Browse files Browse the repository at this point in the history
  • Loading branch information
zcei committed Aug 20, 2018
1 parent 1332e3c commit 35753d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### vNEXT

* ...
* Properly document the `FetcherOperation` to accept a `DocumentNode` [PR #933](https://github.com/apollographql/graphql-tools/pull/933) [Issue #891](https://github.com/apollographql/graphql-tools/issues/891)

### v3.1.1

Expand Down
8 changes: 5 additions & 3 deletions docs/source/remote-schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ You can also use a fetcher (like apollo-fetch or node-fetch) instead of a link.
type Fetcher = (operation: Operation) => Promise<ExecutionResult>;

type Operation {
query: string;
query: DocumentNode;
operationName?: string;
variables?: Object;
context?: Object;
Expand Down Expand Up @@ -162,7 +162,8 @@ Basic usage
```js
import fetch from 'node-fetch';

const fetcher = async ({ query, variables, operationName, context }) => {
const fetcher = async ({ query: queryDocument, variables, operationName, context }) => {
const query = print(queryDocument);
const fetchResult = await fetch('http://api.githunt.com/graphql', {
method: 'POST',
headers: {
Expand All @@ -187,7 +188,8 @@ Authentication headers from context
```js
import fetch from 'node-fetch';

const fetcher = async ({ query, variables, operationName, context }) => {
const fetcher = async ({ query: queryDocument, variables, operationName, context }) => {
const query = print(queryDocument);
const fetchResult = await fetch('http://api.githunt.com/graphql', {
method: 'POST',
headers: {
Expand Down

0 comments on commit 35753d3

Please sign in to comment.