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

Support access: false in items API and schema type printer #5096

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

timleslie
Copy link
Contributor

@timleslie timleslie commented Mar 11, 2021

At the moment, using static false access control breaks the items API and the schema type printer, because we completely parts of the graphQL schema that these systems expect to exist.

This PR is a first pass to unblock the porting of the existing access control tests #4931 and #5097 to keystone-next. These changes are not intended to reflect a final locked in design, but will unblock us from moving forward so that we can follow up with design and testing of this use case in the items API and schema type printer.

@vercel
Copy link

vercel bot commented Mar 11, 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/4bCCxY42Z8CDsCj136ZVcckz1qC8
✅ Preview: https://keystone-next-docs-git-item-api-access-false-keystonejs.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2021

🦋 Changeset detected

Latest commit: aa92687

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@keystone-next/keystone Patch
@keystone-next/test-utils-legacy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@timleslie timleslie force-pushed the item-api-access-false branch from 0850cdd to 8fee740 Compare March 11, 2021 22:00
@vercel vercel bot temporarily deployed to Preview March 11, 2021 22:00 Inactive
@timleslie timleslie requested a review from emmatown March 11, 2021 22:28
@timleslie timleslie force-pushed the item-api-access-false branch from 8fee740 to ff0af4c Compare March 11, 2021 22:29
@vercel vercel bot temporarily deployed to Preview March 11, 2021 22:29 Inactive
@timleslie timleslie changed the title [WIP] Support access: false in items API and schema type printer Support access: false in items API and schema type printer Mar 11, 2021
emmatown
emmatown previously approved these changes Mar 11, 2021
@emmatown emmatown dismissed their stale review March 11, 2021 23:29

found a thing

@@ -4,7 +4,7 @@ export type BaseGeneratedListTypes = {
backing: BackingTypeForItem;
inputs: { create: GraphQLInput; update: GraphQLInput; where: GraphQLInput };
args: {
listQuery: {
listQuery?: {
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this non-optional and for the printing case where we don't have args, instead of printing undefined, print import("@keystone-next-types").BaseGeneratedListTypes["args"]["listQuery"]?

@timleslie timleslie force-pushed the item-api-access-false branch from ff0af4c to e095a41 Compare March 11, 2021 23:37
@vercel vercel bot temporarily deployed to Preview March 11, 2021 23:37 Inactive
@vercel vercel bot temporarily deployed to Preview March 11, 2021 23:40 Inactive
@timleslie timleslie enabled auto-merge (squash) March 11, 2021 23:45
@timleslie timleslie merged commit b7ce464 into master Mar 11, 2021
@timleslie timleslie deleted the item-api-access-false branch March 11, 2021 23:50
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