Neo4j-graphql-js: Sub query array arguments not working

Created on 17 Oct 2018  路  3Comments  路  Source: neo4j-graphql/neo4j-graphql-js

Hi, I'm unable to use array type arguments in sub query.

viewer { firstName itemsByStatus(criteriaF:[OLD, FOO], criteriaB:[BAR, BAZ]){ name } }

The above will not work. It gets the error
Neo4jError: Failed to invoke functionapoc.cypher.runFirstColumn: Caused by: org.neo4j.cypher.ParameterNotFoundException: Expected parameter(s): criteriaF, criteriaB

However, when I remove the array input and make them a single arguments, it works.
itemsByStatus(criteriaF:OLD, criteriaB:BAR)

Love this project! Keep up the great work.

Most helpful comment

This is blocking our move from the neo4j plugin to apollo, so we're keen to get a fix to this too.

All 3 comments

This is blocking our move from the neo4j plugin to apollo, so we're keen to get a fix to this too.

A bit more data on this one. Arrays as top-level query arguments generate valid cypher, but which can't match. e.g.

query team {
  Team(ids: ["someid"]) {
    id
  }
}

generates:

MATCH (`team`:`Team` {ids:$ids}) RETURN `team` {id: ID(`team`)} AS `team` SKIP $offset
{ offset: 0, first: -1, ids: [ 'someid' ] }

Which although doesn't throw an error for us, it does not match. My understanding is that we should be using the in syntax here.

Fixed in #163

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robmurtagh picture robmurtagh  路  3Comments

NathanPimlott picture NathanPimlott  路  4Comments

mobsean picture mobsean  路  4Comments

AdrienLemaire picture AdrienLemaire  路  4Comments

albert-the-creator picture albert-the-creator  路  6Comments