Skip to content
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

Remove context arg from raw() and run() #4945

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Conversation

timleslie
Copy link
Contributor

This argument was mostly for backwards compatibility which is no longer required. None of our remaining use cases need this argument, and it makes the documentation much more confusing to explain.

@vercel
Copy link

vercel bot commented Feb 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/G7UGREB6zwJKHGKc56xLAFrUSD6a
✅ Preview: https://keystone-next-docs-git-remove-context-arg-keystonejs.vercel.app

@vercel vercel bot temporarily deployed to Preview February 25, 2021 02:48 Inactive
@gautamsi
Copy link
Member

What happens if the sub query needs to make another query? Like in access control or in any hooks. Like I want to get some data in afterChange hook and put it in queue

@timleslie
Copy link
Contributor Author

What happens if the sub query needs to make another query? Like in access control or in any hooks. Like I want to get some data in afterChange hook and put it in queue

If you call context.graphql.raw() then that context object will be the one used as the context for the query. You don't need to pass it in explicitly.

@gautamsi
Copy link
Member

Make sense, thought it may be removing the context itself. I guess the context will inherit the sudo or exitSudo state

@timleslie
Copy link
Contributor Author

Make sense, thought it may be removing the context itself. I guess the context will inherit the sudo or exitSudo state

That's correct. This will be made explicit in the documentation.

@timleslie timleslie requested a review from a team February 25, 2021 03:12
@timleslie timleslie enabled auto-merge (squash) February 25, 2021 03:12
@vercel vercel bot temporarily deployed to Preview February 25, 2021 03:12 Inactive
@vercel vercel bot temporarily deployed to Preview February 25, 2021 03:40 Inactive
@timleslie timleslie merged commit 24e0ef5 into master Feb 25, 2021
@timleslie timleslie deleted the remove-context-arg branch February 25, 2021 03:49
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.

3 participants