Update .sudo() to use the internal schema #5084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The static access control rule
access: false
will remove the related queries/mutations from the graphQL schema. When using the.sudo()
context we want to be able to run commands while ignoring access control. This implies that we should be able to execute the queries/mutations associated with the item markedaccess: false
.To make this work we can take advantage of the
internal
schema which is provided by Keystone core, which is a full version of the schema without any of the operations removed.The net impact of this change is to have
.sudo()
behave the way a user would expect, in that they can perform all possible operations in the system.This change is required in order for us to test the access control package, as we need to be able to execute mutations on lists with
{ access: false }
.