简体   繁体   中英

Connect aws-appsync with nextjs

I am trying to connect aws-appsync with a nextjs app. I can't figure out how to do that efficiently.

I have tried using the apollo example in the next js examples on github but did not succeed. I was confused since appsync does not use in-memory cache in the examples on its documentation.

Any help will be appreciated.

Can you use Apollo with Next? If so then maybe try disabling the offline feature of the AWS AppSync client by setting disableOffline to true:

const client = new AWSAppSyncClient({
  disableOffline: true,
  url: appSyncConfig.graphqlEndpoint,
  region: appSyncConfig.region,
  auth: {
    type: appSyncConfig.authenticationType,
    apiKey: appSyncConfig.apiKey,
  }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM