From 05c739ea828755719e1df9d49f26a59acc2d1c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sig=20Narv=C3=A1ez?= Date: Mon, 27 Feb 2023 20:56:17 -0800 Subject: [PATCH] Issue 1 GraphQL endpoint in readme and index.js --- README.md | 7 ++++++- src/index.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aaa48a9..c73f494 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,12 @@ Realm documentation. [Find your App ID](https://docs.mongodb.com/realm/get-started/find-your-app-id/) and paste it into ``src/index.js``. -9. Run the App +9. Add Your GraphQL Endpoint + + [Find your GraphQL Endpoint (URL)](https://www.mongodb.com/docs/atlas/app-services/graphql/expose-data/) and paste it + into ``src/index.js``. + +10. Run the App ```shell npm run start diff --git a/src/index.js b/src/index.js index 7f5c388..4fc0641 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ async function getValidAccessToken() { // Configure the ApolloClient to connect to your app's GraphQL endpoint const client = new ApolloClient({ link: new HttpLink({ - uri: `https://realm.mongodb.com/api/client/v2.0/app/${APP_ID}/graphql`, + uri: ``, // We define a custom fetch handler for the Apollo client that lets us authenticate GraphQL requests. // The function intercepts every Apollo HTTP request and adds an Authorization header with a valid // access token before sending the request.