【问题标题】:Connect aws-appsync with nextjs将 aws-appsync 与 nextjs 连接
【发布时间】:2018-07-29 18:35:31
【问题描述】:

我正在尝试将 aws-appsync 与 nextjs 应用程序连接起来。我无法弄清楚如何有效地做到这一点。

我已经尝试在 github 上的下一个 js 示例中使用 apollo 示例,但没有成功。我很困惑,因为 appsync 在其文档的示例中没有使用内存缓存。

任何帮助将不胜感激。

【问题讨论】:

标签: amazon-web-services graphql react-apollo nextjs aws-appsync


【解决方案1】:

您可以将 Apollo 与 Next 一起使用吗?如果是这样,那么可以尝试通过将 disableOffline 设置为 true 来禁用 AWS AppSync 客户端的离线功能:

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

【讨论】:

    猜你喜欢
    • 2020-12-05
    • 2020-07-30
    • 1970-01-01
    • 2022-11-13
    • 2021-03-08
    • 2021-09-19
    • 2020-11-12
    • 1970-01-01
    • 2021-08-27
    相关资源
    最近更新 更多