【问题标题】:Mutation in GraphQL using apollo and AWS使用 apollo 和 AWS 在 GraphQL 中进行突变
【发布时间】:2018-12-20 06:24:39
【问题描述】:
const query = require('graphql-tag');
  const x = query(`
  mutation Hello {
  putPost(
    category: "College",
      institution: "Some College",
      address: "DisneyLand",
      country: "India",
      state: "Some State",
      city: "Some City"
  ){
    category
  }
}`);

  const client = new AWSAppSyncClient({
    url: url,
    region: region,
    auth: {
      type: type,
      apiKey:apiKey,
    }
  });
  console.log(x);

  client.hydrated().then(function (client) {
    return client.mutate({mutation : x})
  }).then(function logData(data) {
    console.log("This is the data returned " + data);
  }).catch(console.error);
}

我正在尝试使用 AWS 服务及其 Apollo SDK 更改我的数据库,我无法更改我的数据并且出现错误“TypeError: Cannot read property 'queryManager' of undefined”,谁能帮助我?

【问题讨论】:

    标签: amazon-web-services apollo-client aws-appsync


    【解决方案1】:

    经过一番挖掘,我发现这是 Aws-appsync 模块的版本问题。我安装了“1.0.22”,一切正常。我希望它可以帮助某人。

    【讨论】:

      猜你喜欢
      • 2019-11-27
      • 2020-11-04
      • 2020-04-24
      • 2021-02-17
      • 1970-01-01
      • 1970-01-01
      • 2017-02-07
      • 2019-06-11
      • 2020-01-16
      相关资源
      最近更新 更多