Add an @take(n: Int!)
directive
#316
Labels
A-syntax
Area: query or schema syntax
C-feature-request
Category: request for new future functionality
This would allow for only taking the first entry in an iterator, or only taking two, or whatever. This is already possible at the root vertex because you decide how many you want to take from the iterator for
execute_query
but having something like this in trustfall would enable not consuming an entire iterator of an edge or list.A recent example would be a linter:
Where I only needed the first argument of the arguments iterator.
Alternatives: The best you can hope for is to subclass your iterator to a new edge that has a take edge with edge properties for how many to take, This makes the query and schema much more confusing for not much reason if this can be implemented natively. Example:
The text was updated successfully, but these errors were encountered: