Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to @tag properties inside a @fold, then use the tags outside that @fold #341

Open
obi1kenobi opened this issue Jul 6, 2023 · 1 comment
Labels
A-ir Area: compiler intermediate representation A-syntax Area: query or schema syntax C-feature-request Category: request for new future functionality E-medium Call for participation: experience needed to fix: medium / intermediate

Comments

@obi1kenobi
Copy link
Owner

obi1kenobi commented Jul 6, 2023

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,
}
@obi1kenobi obi1kenobi added A-syntax Area: query or schema syntax A-ir Area: compiler intermediate representation C-enhancement Category: raise the bar on expectations E-medium Call for participation: experience needed to fix: medium / intermediate C-feature-request Category: request for new future functionality and removed C-enhancement Category: raise the bar on expectations labels Jul 6, 2023
@u9g
Copy link
Contributor

u9g commented Aug 4, 2023

when this is implemented, having only @tag inside the @fold body should also disable the optimization in #423, the same as if we had an @output instead of the @tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ir Area: compiler intermediate representation A-syntax Area: query or schema syntax C-feature-request Category: request for new future functionality E-medium Call for participation: experience needed to fix: medium / intermediate
Projects
None yet
Development

No branches or pull requests

2 participants