代码之家  ›  专栏  ›  技术社区  ›  Ian Likono

将aws appsync与nextjs连接

  •  1
  • Ian Likono  · 技术社区  · 6 年前

    我正在尝试将aws appsync与nextjs应用程序连接。我不知道如何有效地做到这一点。

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

    任何帮助都将不胜感激。

    1 回复  |  直到 6 年前
        1
  •  2
  •   Richard    6 年前

    你能用Apollo和Next吗?如果是这样,可以通过设置 disableOffline 为真:

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