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

Add tests for null relationship input #5016

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Conversation

timleslie
Copy link
Contributor

Relationship fields in create and update operations currently accept null as a valid GraphQL input. This is not currently handled correctly, see #5014 .

This PR adds tests and clarifies that null input is equivalent to undefined input, e.g. does not set or change the field value.

In the future we might need to revisit whether we want to disallow null as an input value, or apply different semantics (e.g. null being equivalent to disconnectAll in update). This PR is simply setting a well defined baseline to build on.

@vercel
Copy link

vercel bot commented Mar 4, 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/6nco619TiTUg42qXyb79Xy7nBgXd
✅ Preview: https://keystone-next-docs-git-null-relationship-test-keystonejs.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2021

🦋 Changeset detected

Latest commit: 1e6fb0c

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-legacy Patch
@keystone-next/api-tests-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

@vercel vercel bot temporarily deployed to Preview March 4, 2021 21:47 Inactive
@vercel vercel bot temporarily deployed to Preview March 4, 2021 22:01 Inactive
@vercel vercel bot temporarily deployed to Preview March 4, 2021 22:13 Inactive
@vercel vercel bot temporarily deployed to Preview March 4, 2021 22:28 Inactive
@timleslie timleslie force-pushed the null-relationship-test branch from 37d5a10 to 1e6fb0c Compare March 4, 2021 22:41
@vercel vercel bot temporarily deployed to Preview March 4, 2021 22:41 Inactive
@timleslie timleslie changed the title [WIP] Add tests for null relationship input Add tests for null relationship input Mar 4, 2021
@timleslie timleslie requested review from a team and rohan-deshpande and removed request for a team and rohan-deshpande March 4, 2021 22:42
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