简体   繁体   English

使用 Ember graphql-adapter 和 postgraphql 时遇到问题

[英]Trouble using Ember graphql-adapter and postgraphql

Ember and Graphql are both new to me and i'm trying to get my application working with Postgraphql without success Ember 和 Graphql 对我来说都是新手,我正在尝试让我的应用程序与 Postgraphql 一起工作但没有成功

I use Ember and https://github.com/alphasights/ember-graphql-adapter but the query made by ember-graphql-adapter doesn't match the query needed by Postgraphql我使用 Ember 和https://github.com/alphasights/ember-graphql-adapter但 ember-graphql-adapter 进行的查询与 Postgraphql 所需的查询不匹配

I want to get a company in my DB, the query working with Postgraphql is:我想在我的数据库中找到一家公司,使用 Postgraphql 的查询是:

query {
  companiesNodes(rowId: 1) {
    nodes {
        id
        rowId
        name
    }
  }   
}

But my app is sending this payload:但我的应用程序正在发送此有效负载:

query {
  companies(id: 1) {
      id
      rowId
      name
  }
}

How can i modify the second query sent by Ember-graphql-adapter to be wrapped like the first one ?如何修改 Ember-graphql-adapter 发送的第二个查询,使其像第一个查询一样包装?

The generated query is missing the "nodes" bit because ember-graphql-adapter has not implemented any pagination related parts of the GraphQL spec.生成的查询缺少“节点”位,因为 ember-graphql-adapter 尚未实现 GraphQL 规范的任何分页相关部分。 It's focus has been to make the basics work with Ember Data since Ember Data works with JSON API directly.由于 Ember Data 直接与 JSON API 一起工作,因此重点是使基础知识与 Ember Data 一起工作。

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

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