Closed leewesleyv closed 3 years ago
The simplest solution would be to do what the REST API does -- filter the querysets based on the request site - https://github.com/wagtail/wagtail/blob/8c306910dd86e09cea11196715da47c6a54c722b/wagtail/api/v2/views.py#L418
that way siteA.com/api
returns everything that falls under Site a, wheas siteB.com/api
returns pages under Site B
Additionally, add a new site
query that you can wrap the other querie in. e.g.
{
siteA: site(id: 123) {
pages { ... }
}
siteB: site(hostname: "...") {
pages { ... }
}
}
Thank you @zerolab for the input. I will open a PR when I have some time 😃
Issue It would be nice if
wagtail-grapple
would support a multi-site setup. E.g., there currently is no support for filtering page/pages based on a site. In a multi-site scenario, duplicate slugs can exist, and fetching a page would result in no results from the page query.My idea Add a filter to the page/pages query. We could for example introduce
hostname
as an optional parameter for these queries and filter the page QuerySet that way.Open questions