Open wheresrhys opened 4 years ago
If I have a property (...) which is a list
I'm assuming you mean a property on a node in your Neo4j graph, but w.r.t. graphql strictly, just to clarify:
You mean a field in a type in your schema, yes?
Yes. To be absolutely precise the type would be something like
type MyThing {
myProp: [String]
}
And I want to be able to query with
{
MyThing(filter: {
myProp_contains: "some string"
}) {
// some properties
}
}
Which would run something akin to this in cypher:
MATCH (node:MyThing)
WHERE "some string" IN node.myProp
...
Issue should be closed, because PR #513
Not sure to open a new Issue but: As is said yesterday. The filter for list properties is working.
When you chain filters with AND or OR the filter isn´t working anymore.
For example:
typeDef:
type MyThing { myProp: [String] myOtherProp: String }
Totally fine:
query test { MyThing(filter: { myProp: ["abc"] }) { myProp myOtherProp } }
Not working: --> empty result. (I´m sure, there should be results)
query test2 { MyThing(filter: { AND: [ { myProp: ["abc"] }, { myOtherProp: "def" } ] }) { myProp myOtherProp } }
If I have a property,
myProp
, which is a list of strings or enums, I would like to be able to use amyProp_contains
filter.It looks like the lack of filters is by design https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/src/augment/input-values.js#L69, and most filters wouldn't make sense for lists, but
contains
querying feels like a very valid use case, and would map well to usingIN
in the underlying cypher.I'm happy to submit a PR if you're in favour of the feature