Trouble using Ember graphql-adapter and postgraphql

276 Views Asked by At

Ember and Graphql are both new to me and i'm trying to get my application working with Postgraphql without success

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

I want to get a company in my DB, the query working with Postgraphql is:

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 ?

1

There are 1 best solutions below

0
On

The generated query is missing the "nodes" bit because ember-graphql-adapter has not implemented any pagination related parts of the GraphQL spec. It's focus has been to make the basics work with Ember Data since Ember Data works with JSON API directly.