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

Make effect delay and network detection configurables #388

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(readme) switch AppSync.js to aws-exports.js (#373)
I can't find anywhere in the console that I can download a file named AppSync.js... but I have aws-exports.js.

The docs are still very confusing when new to all of these libraries that can be mixed and matched.

I can get the Amplify CLI to work out of the box, but as soon as you try to add AWSAppSyncClient instead and use the Apollo client things get very confusing to me.
  • Loading branch information
nateous authored and elorzafe committed Mar 20, 2019
commit af84d3e3d9323a534b64af46e6830e0e7c7e572f
14 changes: 7 additions & 7 deletions tutorials/react-offline-realtime-todos/README.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ input UpdateTodoInput {
}
```

**Save** the schema again. On the navigation bar in the left of the console, click on `<your api name>`, scroll down and select the **Web** section then click **Download** and save the `AppSync.js` file somewhere for later.
**Save** the schema again. On the navigation bar in the left of the console, click on `<your api name>`, scroll down and select the **Web** section then click **Download Config** and save the `aws-exports.js` file somewhere for later.

## Imports and configuration

@@ -65,25 +65,25 @@ create-react-app todos && cd ./todos
yarn add aws-appsync aws-appsync-react graphql-tag react-apollo
```

Copy the `AppSync.js` file that you downloaded from the console into the `./todos/src` directory. Next add the following imports towards the top of the `App.js` file:
Copy the `aws-exports.js` file that you downloaded from the console into the `./todos/src` directory. Next add the following imports towards the top of the `App.js` file:


```javascript
import AWSAppSyncClient, { buildSubscription } from 'aws-appsync';
import { Rehydrated, graphqlMutation } from 'aws-appsync-react';
import AppSyncConfig from './AppSync';
import awsmobile from './aws-exports';
import { ApolloProvider } from 'react-apollo';
```

Replace everything __after__ the definition of the `<App />` component with the following configuration:

```jsx
const client = new AWSAppSyncClient({
url: AppSyncConfig.graphqlEndpoint,
region: AppSyncConfig.region,
url: awsmobile.graphqlEndpoint,
region: awsmobile.region,
auth: {
type: AppSyncConfig.authenticationType,
apiKey: AppSyncConfig.apiKey
type: awsmobile.authenticationType,
apiKey: awsmobile.apiKey
}
})