How to use the aws-appsync.AWSAppSyncClient function in aws-appsync

To help you get started, we’ve selected a few aws-appsync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gnemtsov / ab-app2 / frontend / src / index.jsx View on Github external
url:
        process.env.NODE_ENV === "development"
            ? process.env.REACT_APP_LOCAL_APPSYNC_URL
            : "https://vipqqwuxvfdn7gaos7u4aav3su.appsync-api.eu-west-1.amazonaws.com/graphql",
    region: "eu-west-1",
    auth: {
        type: AUTH_TYPE.AWS_IAM,
        credentials: new AWS.CognitoIdentityCredentials({
            IdentityPoolId: "eu-west-1:dffe4e03-9e89-4118-911f-ee327e257d9f"
        })
    }
});

const link = ApolloLink.from([authLink, errorLink, appSyncLink]);

const client = new AWSAppSyncClient({ disableOffline: true }, { link });

const app = (
    
        
            
                {client => }
            
        
    
);

ReactDOM.render(app, document.getElementById("root"));
registerServiceWorker();