neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Only first result returned for custom query / resolver
I have this bizarre behaviour whereby I only get the first result returned for a query. I assumed I am making some mistake but I really can't figure it out.
type Query {
Idiom(
name: String,
type: IdiomType,
description: String,
lifecycle: IdiomLifecycle,
quality: Float
_id: String
first: Int
offset: Int
orderBy: [_IdiomOrdering]
filter: _IdiomFilter
): Idiom
}
const resolvers = {
Query: {
Idiom(object, params, ctx, resolveInfo) {
if (!ctx.user) {
throw new AuthenticationError('You must be authenticated!');
} else {
return neo4jgraphql(object, params, ctx, resolveInfo);
}
},
}
};
MATCH (`idiom`:`Idiom`) RETURN `idiom` { .name } AS `idiom`
{
"offset": 0,
"first": -1,
"cypherParams": {
"currentUserId": "2f3df7b697aebe899fa5bd90012ffbe440537274"
}
}
hey @infornite shouldn't your return type be an array of Idiom like [Idiom]??
I think then you would get an array of type Idiom, not a single record
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608