简体   繁体   English

将AWS-AppSync与NextJS连接

[英]Connect aws-appsync with nextjs

I am trying to connect aws-appsync with a nextjs app. 我正在尝试将aws-appsync与nextjs应用程序连接。 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. 我尝试在github上的下一个js示例中使用apollo示例,但未成功。 I was confused since appsync does not use in-memory cache in the examples on its documentation. 我很困惑,因为appsync在其文档的示例中未使用内存缓存。

Any help will be appreciated. 任何帮助将不胜感激。

Can you use Apollo with Next? 您可以将Apollo与Next一起使用吗? If so then maybe try disabling the offline feature of the AWS AppSync client by setting disableOffline to true: 如果是这样,则可以通过将disableOffline设置为true来尝试禁用AWS AppSync客户端的离线功能:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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