Re:Introducing OpenCypher, the open graph query language pro...
by optimuspaul on Friday October 23, 2015 @12:01AM
(#10436728)
I believe that is coming. The latest spec has variables for some use cases.
Re:Introducing OpenCypher, the open graph query language pro...
by lobster_johnson on Friday October 23, 2015 @01:59AM
(#10437033)
The latest spec's "variables" let you pass simple parameters to a query. I don't see it going in the direction of a general-purpose graph query language.
It's better to understand GraphQL as a protocol that competes with REST. It's only a language in the sense that JSON is a language; i.e., it has a syntax that can be parsed.
For example, GraphQL supports queries like this:
But this is something the particular schema and implementation would need to implement. If you want to filter by arbitrary attributes, you're out of luck because the spec is just a syntax. I suppose you do something like: but you still have to invent a standard set of parameters here: min, max, eq, notEq, lessThan, lessThanOrEq, like, etc. Again, totally ad hoc.GraphQL, not being a language, also doesn't support variable bindings. So you cannot do self-referencing queries like "find all movies with a director who also acted in it", because that would require some kind of variable support.
(This is not a criticism of GraphQL, by the way. It's great at what it's defined for.)