Skip to content

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

Merged
jasonvarga merged 5 commits into
statamic:5.xfrom
ryanmitchell:features/query-scopes-in-graphql
Mar 25, 2025
Merged

jasonvarga merged 5 commits into
statamic:5.xfrom
ryanmitchell:features/query-scopes-in-graphql

Conversation

@ryanmitchell

@ryanmitchell ryanmitchell commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

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
@jasonvarga

Copy link
Copy Markdown
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
Copy Markdown
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