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

[5.x] Support query scopes in GraphQL #11533

Merged

Conversation

ryanmitchell
Copy link
Contributor

@ryanmitchell ryanmitchell commented Mar 5, 2025

Building on the PR I opened for the REST API (#10893) this PR adds QueryScope support to the EntriesQuery in GraphQL.

This allows you to write queries such as:

{
    entries (query_scope: { test_scope: { my_param: "a" } }) {
        current_page
        data {
            id
            title
        }
    }
}

And your test_scope query scope will be applied to the results.

I've only applied this to the EntriesQuery for now but am happy to apply it out to others if you feel it appropriate.

@ryanmitchell ryanmitchell changed the title [5.x] Support query scopes in REST API [5.x] Support query scopes in GraphQL Mar 5, 2025
@jasonvarga jasonvarga merged commit f098566 into statamic:5.x Mar 25, 2025
24 checks passed
@jasonvarga
Copy link
Member

I've only applied this to the EntriesQuery for now but am happy to apply it out to others if you feel it appropriate.

I've merged this as-is. If you want to roll it out, go for it, or we can wait until there's demand.

@ryanmitchell ryanmitchell deleted the features/query-scopes-in-graphql branch March 25, 2025 19:51
@ryanmitchell
Copy link
Contributor Author

We only wanted it for entries so I’ll let others add it if they need it.

Thanks for the merges!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants