Skip to content

Commit

Permalink
Fix undefined types when omitted from GraphQL (#8300)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
  • Loading branch information
dcousens and dcousens committed Feb 13, 2023
1 parent c14fa5c commit 7ebc68e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-papayas-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Fix undefined types when using `omit` for create or update
8 changes: 8 additions & 0 deletions packages/core/src/lib/schema-type-printer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,21 @@ function printListTypeInfo<L extends InitialisedList>(listKey: string, list: L)
` inputs: {`,
` where: ${whereInputName};`,
` uniqueWhere: ${whereUniqueInputName};`,
...(list.graphql.isEnabled.create ? [
` create: ${createInputName};`,
] : []),
...(list.graphql.isEnabled.update ? [
` update: ${updateInputName};`,
] : []),
` orderBy: ${listOrderName};`,
` };`,
` prisma: {`,
...(list.graphql.isEnabled.create ? [
` create: Resolved${createInputName}`,
] : []),
...(list.graphql.isEnabled.update ? [
` update: Resolved${updateInputName}`,
] : []),
` };`,
` all: __TypeInfo;`,
` };`,
Expand Down

1 comment on commit 7ebc68e

@vercel
Copy link

@vercel vercel bot commented on 7ebc68e Feb 13, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.