Skip to content

Commit

Permalink
Update schema-type-printer to output "never" for omitted GraphQL types (
Browse files Browse the repository at this point in the history
keystonejs#8355)

Co-authored-by: Josh Calder <josh@opensaas.com.au>
  • Loading branch information
acburdine and borisno2 authored Mar 2, 2023
1 parent c3ce0da commit ce600cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-cougars-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Fixes schema type printer to output `never` for omitted types.
16 changes: 4 additions & 12 deletions packages/core/src/lib/schema-type-printer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,13 @@ function printListTypeInfo<L extends InitialisedList>(
` inputs: {`,
` where: ${whereInputName};`,
` uniqueWhere: ${whereUniqueInputName};`,
...(list.graphql.isEnabled.create ? [
` create: ${createInputName};`,
] : []),
...(list.graphql.isEnabled.update ? [
` update: ${updateInputName};`,
] : []),
` create: ${list.graphql.isEnabled.create ? createInputName : 'never'};`,
` update: ${list.graphql.isEnabled.update ? updateInputName : 'never'};`,
` orderBy: ${listOrderName};`,
` };`,
` prisma: {`,
...(list.graphql.isEnabled.create ? [
` create: Resolved${createInputName}`,
] : []),
...(list.graphql.isEnabled.update ? [
` update: Resolved${updateInputName}`,
] : []),
` create: ${list.graphql.isEnabled.create ? `Resolved${createInputName}` : 'never'};`,
` update: ${list.graphql.isEnabled.update ? `Resolved${updateInputName}` : 'never'};`,
` };`,
` all: __TypeInfo;`,
` };`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ export declare namespace Lists {
orderBy: TodoOrderByInput;
};
prisma: {
create: ResolvedTodoCreateInput
update: ResolvedTodoUpdateInput
create: ResolvedTodoCreateInput;
update: ResolvedTodoUpdateInput;
};
all: __TypeInfo;
};
Expand Down

0 comments on commit ce600cf

Please sign in to comment.