trustfall
trustfall copied to clipboard
Ability to `@tag` properties inside a `@fold`, then use the tags outside that `@fold`
For example, on the "numbers" schema:
query {
Four {
# Get a list of prime factors and call it "primes".
primeFactor @fold {
primes: value @tag @output
}
# One of those primes is two less than this number.
predecessor {
predecessor {
value @filter(op: "one_of", value: ["%primes"]) @output
}
}
}
}
This should return:
{
"primes": [2],
"value": 2,
}
when this is implemented, having only @tag
inside the @fold
body should also disable the optimization in https://github.com/obi1kenobi/trustfall/pull/423, the same as if we had an @output
instead of the @tag