petterik / lajter

MIT License
3 stars 0 forks source link

Index graphql field inputs #57

Open petterik opened 5 years ago

petterik commented 5 years ago

As fields can have inputs, we need to index those fields somehow.

The first idea is to have:

[Query [^User ^Many users]
 Query.Input [field name type cardinality required?]]

Multiple Query.Input can point to the same field.

petterik commented 5 years ago

When returning query results, there should be one query entity per set of inputs.

So a Query type should also have an inputs field:

[Query [^Query.Input ^many -inputs]]

Added one dash to signal that it's an internal field and so that it doesn't collide with other fields. Not using underscore, as it means something else in datascript (reverse lookup) and I've seen graphql API's using double underscores for internal stuff, e.g. schema type

petterik commented 5 years ago

This means that all queries that have no inputs will go on the same Query entity.