diff --git a/docs/source/index.mdx b/docs/source/index.mdx index 943c8b63aa..36b95f52e4 100644 --- a/docs/source/index.mdx +++ b/docs/source/index.mdx @@ -139,10 +139,10 @@ const link = new HttpLink({ uri }); const operation = { query: gql`query { hello }`, - variables: {} //optional - operationName: {} //optional - context: {} //optional - extensions: {} //optional + variables: {}, //optional + operationName: {}, //optional + context: {}, //optional + extensions: {}, //optional }; // execute returns an Observable so it can be subscribed to @@ -150,12 +150,12 @@ execute(link, operation).subscribe({ next: data => console.log(`received data: ${JSON.stringify(data, null, 2)}`), error: error => console.log(`received error ${error}`), complete: () => console.log(`complete`), -}) +}); // For single execution operations, a Promise can be used makePromise(execute(link, operation)) .then(data => console.log(`received data ${JSON.stringify(data, null, 2)}`)) - .catch(error => console.log(`received error ${error}`)) + .catch(error => console.log(`received error ${error}`)); ``` > Note: to run Apollo Link on the server, ensure that you install `node-fetch` and pass its default export to as the `fetch` parameter to `HttpLink`