-
Notifications
You must be signed in to change notification settings - Fork 641
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
GraphQL public schema changes #6078
Comments
I'm not sure how you ended up with multiple schemas in the Have you tried re-saving the public token in the control panel? If that doesn't quite work, I think in this case it's perfectly acceptable to restore to link in the database by setting the record ID manually. |
@andris-sevcenko I think somehow something is wrong tho. Recently deleted the Search "scope" and switched to public, but do get on prod/staging the same error. This is what left in
While all that exists, is the public schema, search has been deleted. Craft Edition: 3.4.25 |
I'm having what seems to be a related problem: When syncing project.yaml onto a clean install of Craft it doesn't create a gqltoken for the public schema at all (though it does sync the public schema itself correctly) and there is no way to create this public token in the new environment if allowAdminChanges is false. The probable solution to this would be: |
@Kethatril Thanks for pointing that out! We are looking into how we can improve that. |
This makes it possible to tweak the public access settings on sites with `allowAdminChanges` setting set to `true`. Resolve #6078
As of the next 3.5 release, the public schema’s access settings (Enabled, Expiry Date) will be stored in the project config. So you still won’t be able to directly edit it from environments with |
Description
I'm having a problem using project.yaml and setting up GraphQL Public Schema. I have
allowAdminChanges
false in staging and production environments.We needed to make some changes to our public schema — somehow we ended up with multiple public schema entries in our
project.yaml
. We manually deleted the extra ones. This probably would have worked fine if we'd managed to keep the same public schema ID that was originally created.In development, the Public Schema works as it should (presumably because it was created in development environment) — when making GraphQL queries it doesn't require the Authorization header. In staging and production, after synching with the project.yaml, Craft won't allow me to make queries to CraftQL, they all get rejected with Status 400
{"error":"Missing Authorization header"}
.I've verified that in the staging and production databases the
gqlschemas
andgqltokens
are created.What I noticed was that the
gqltokens
record for the__PUBLIC__
accessToken has an empty schemaId field after the project.yaml sync. It appears this field isn't getting populated. Manually setting it to the createdgqlschemas
record ID is a workaround but sorts the problem.Steps to reproduce
allowAdminChanges
false and ensure project.yaml is enabled.Additional info
The text was updated successfully, but these errors were encountered: