A GraphQLError is no longer raised if querying for a Site with a hostname that doesn't exist (as this is an expected error) - similar to what already happens when querying for a Site by ID that doesn't exist
Consolidates the handling of site resolving to reduce code
We no longer return Pages for the first Site when querying for Pages with an erroneous Site filter (i.e. providing a hostname=does.not.exist query filter should not return Pages for the first Site - it should return None).
We no longer return SiteSettings for the first Site when querying for SiteSettings without a site filter when there are multiple Sites.
Also, I had to remove a migration dependency for taggit when initialising an empty database - I didn't look into why, though I did confirm that taggit migrations are still run as Wagtail requires 'em.
https://github.com/torchbox/wagtail-grapple/issues/340 identifies that the handling of resolving sites is inconsistent depending on the context.
This MR addresses that so that:
GraphQLError
is no longer raised if querying for aSite
with a hostname that doesn't exist (as this is an expected error) - similar to what already happens when querying for aSite
by ID that doesn't existPage
s for the firstSite
when querying forPage
s with an erroneousSite
filter (i.e. providing ahostname=does.not.exist
query filter should not returnPage
s for the firstSite
- it should returnNone
).SiteSetting
s for the firstSite
when querying forSiteSetting
s without a site filter when there are multipleSite
s.Also, I had to remove a migration dependency for
taggit
when initialising an empty database - I didn't look into why, though I did confirm thattaggit
migrations are still run as Wagtail requires 'em.