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 queryLimits.maxResults, add maximumTake #7963

Merged
merged 15 commits into from
Oct 10, 2022
Merged

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Sep 27, 2022

This pull request removes context.totalResults and context.maxTotalResults.

This state was not carried between .sudo, .exitSudo, or .withSession methods, and is not actually useful for anything except some broad/inaccurate statistics. You should not be using these for any form of security or session control.

I recommend we remove the feature completely, if developers want to track a session, they can rely on a custom session strategy.
If developers want to track access to items, they can use the access control functions.

This pull request additionally adds [list].graphql.maximumTake, a list configuration option to enforce the maximum take value in findMany queries for that list. This functionality is unambiguous and has clear behavioral boundaries.

TODO

  • Implementation
  • Tests
  • Documentation

@changeset-bot

This comment was marked as resolved.

@vercel

This comment was marked as resolved.

@dcousens dcousens self-assigned this Sep 27, 2022
@vercel vercel bot temporarily deployed to Preview September 27, 2022 06:50 Inactive
@codesandbox-ci

This comment was marked as resolved.

@dcousens dcousens changed the title Remove stateful context data Remove result tracking in context Sep 28, 2022
@vercel vercel bot temporarily deployed to Preview October 3, 2022 02:53 Inactive
@dcousens dcousens marked this pull request as ready for review October 3, 2022 02:58
@dcousens dcousens changed the title Remove result tracking in context Remove queryLimits.maxResults, add queryLimits.take Oct 6, 2022
@dcousens dcousens marked this pull request as draft October 6, 2022 04:43
@vercel vercel bot temporarily deployed to Preview October 6, 2022 04:46 Inactive
@vercel vercel bot temporarily deployed to Preview October 6, 2022 05:03 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 02:52 Inactive
@dcousens dcousens marked this pull request as ready for review October 10, 2022 02:54
@dcousens dcousens changed the title Remove queryLimits.maxResults, add queryLimits.take Remove queryLimits.maxResults, add maximumTake Oct 10, 2022
@vercel vercel bot temporarily deployed to Preview October 10, 2022 02:58 Inactive
@@ -386,8 +386,6 @@ Options:

- `debug` (default: `process.env.NODE_ENV !== 'production'`): If `true`, stacktraces from both Apollo errors and Keystone errors will be included in the errors returned from the GraphQL API.
These can be filtered out with `apolloConfig.formatError` if you need to process them, but do not want them returned over the GraphQL API.
- `queryLimits` (default: `undefined`): Allows you to limit the total number of results returned from a query to your GraphQL API.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed many moons ago

@vercel vercel bot temporarily deployed to Preview October 10, 2022 03:42 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 03:44 Inactive
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs changes need conditionals (at least for the additions)

@vercel vercel bot temporarily deployed to Preview October 10, 2022 03:52 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:02 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:13 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:17 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:31 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:41 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 04:58 Inactive
Co-authored-by: Mitchell Hamilton <[email protected]>
@vercel vercel bot temporarily deployed to Preview October 10, 2022 05:01 Inactive
@vercel vercel bot temporarily deployed to Preview October 10, 2022 05:05 Inactive
@dcousens dcousens merged commit 25b5bb6 into main Oct 10, 2022
@dcousens dcousens deleted the no-context-state branch October 10, 2022 07:05
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.

2 participants