Neo4j-graphql-js: Bug: first/offset fails in inner field

Created on 29 Mar 2018  路  6Comments  路  Source: neo4j-graphql/neo4j-graphql-js

Adding first/offset to inner fields returns empty results always, as the first/offset are added into the query and filter out all results.

Example query:

    {
      myList(id: "1234") {
        items(first: 2) {
          id
        }
      }
    }

results in query:
MATCH (myList:MyList {id:"1234"}) RETURN myList {items: [(myList)-[:HAS]->(myList_items:Item{first: "2"}) | myList_items { .id }][..2] } AS myList SKIP 0

which because of the {first: "2"} doesn't match any Item.

If the queryParams (source code) were left empty, it would work since the skipLimit applies the pagination.

All 6 comments

@fwanicka Looks like it's a regression introduced by #33

Probably fixed by filtering first and offset out of queryParams, can you confirm?

That sounds right. I will look at it today.

I wonder if you have an idea for #38 of the top of your head, I can't find suitable cypher syntax.

Sorry for delay. I will get a pull request in for the defect tomorrow. I will also see if I can find a suitable cypher syntax for that issue.

Ok, the defect fix pull request has been merged. I will look into ordering on @relation directives.

looks like this is working!

Was this page helpful?
0 / 5 - 0 ratings