Skip to content

fix(graphql): virtual fields should be nullable in GraphQL schema (#16112)#16193

Open
deepshekhardas wants to merge 3 commits intopayloadcms:mainfrom
deepshekhardas:fix/16112-virtual-field-graphql
Open

fix(graphql): virtual fields should be nullable in GraphQL schema (#16112)#16193
deepshekhardas wants to merge 3 commits intopayloadcms:mainfrom
deepshekhardas:fix/16112-virtual-field-graphql

Conversation

@deepshekhardas
Copy link
Copy Markdown
Contributor

Fixes #16112 - Virtual field marked as required in GraphQL schema

Problem: Virtual fields that are marked as
equired: true are still required in GraphQL mutation inputs, but they shouldn't be since they're computed by hooks, not stored.

Solution: Added a check for virtual fields in withNullableType.ts to ensure virtual fields are always nullable in GraphQL inputs, regardless of their
equired setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual field is marked as required in the GraphQL schema

1 participant