neo4j-graphql / neo4j-graphql-js

NOTE: This project is no longer actively maintained. Please consider using the official Neo4j GraphQL Library (linked in README).
Other
609 stars 147 forks source link

How to generate a query for a [String] type #221

Open bencpeters opened 5 years ago

bencpeters commented 5 years ago

I have a schema that has nodes with properties that are arrays of Strings ([String]). This gets parsed properly by the type generator, but the autogenerated query just expects the base type (e.g. String), and doesn't properly use the Cypher IN directive (it just performs a regular filter operation). Is there any way to fix this in the configuration, or do I need to write custom queries for everything that uses these filter fields?

Example Schema:

type Project { 
  nameWithOwner: String, 
  topics: [String]!,
  languages: [String]!,
  url: String, forks: String, 
  description: String
}

Sample of the Query generated in the playground schema explorer:

image

image

Am I missing something here? Thanks!

hacker-DOM commented 5 years ago

Yup, experiencing the issue as well.

Ironykins commented 4 years ago

I'm experiencing a slightly different but probably related issue. I'm parsing input types in conjunctive normal form, so I'm using lists of lists of input types. neo4j-graphql-js handled this fine in version 2.7.1 and prior, but new versions break it.

A snippet from my schema:

input _CardFilter {
  FulltextQuery: String
  CardType: String
  # NOTE: This actually BREAKS on neo4j-graphql-js versions > 2.7.1. Newer versions turn this into a single list, rather than a list of lists. This is a problem. 
  PropertyFilters: [[_CardPropertyFilter]] # Property filters in conjunctive normal form eg. [[FILTER1 (or) FILTER2] AND [FILTER3] AND [FILTER4 OR FILTER5]]
  RelationshipFilters: [_CardRelationshipFilter]
}

And the result it spits out: image

PropertyFilters should be a list of lists, but it gets turned into a list. Turning it into a list of lists of lists results in the same generated schema.

Something may be wrong with how neo4j-graphql-js parses lists?

NawarA commented 4 years ago

@johnymontana I noticed you had #221 on the v2.16.0 released board, but it didn't make it into the release.

Looking at the release board, it looks #350 and #221 are related -> both are stating DB users cannot query arrays.

Can you share when you plan to release this?

How this issue effects me: Not being able to query anything stored in [String] data types is seriously screwing with my schema. I'm considering having to create N number of nodes containing single String props, and then link them all by edges (since thats the only way to query currently)...its super wasteful..and the wrong direction for a production DB 😢 but how else will be able to query an array of strings? This simple feature will be massively useful

When do you think you'll get #350 and #221 released? Its kinda super important to me and the community

Thank you ❤️

NawarA commented 4 years ago

@johnymontana hi, checking in, would you mind replying to my question above?

As a quick reminder...(with emphasis)...

Developers cannot query Arrays.

As a user who is building a production-grade system on this, I consider this a CRITICAL bug.

I'd like to politely request you consider this issue as the #1 priority.

Can you share where you and team are on the issue? When can we expect a patch?

Its super important to me and the community. 🙏 Thank you @johnymontana

michaeldgraham commented 3 years ago

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608