Skip to content

Commit

Permalink
Fix .keystone/types including invalid definitions (#8256)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens authored Jan 17, 2023
1 parent a56240e commit 7c723d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-strawberries-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Fix .keystone/types including invalid definitions
17 changes: 11 additions & 6 deletions packages/core/src/lib/schema-type-printer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,17 @@ export function printGeneratedTypes(
const gqlNames = getGqlNames(list);
const listTypeInfoName = `Lists.${listKey}.TypeInfo`;

interimCreateUpdateTypes.push(
printInterimType(list, listKey, gqlNames.createInputName, 'Create')
);
interimCreateUpdateTypes.push(
printInterimType(list, listKey, gqlNames.updateInputName, 'Update')
);
if (list.graphql.isEnabled.create) {
interimCreateUpdateTypes.push(
printInterimType(list, listKey, gqlNames.createInputName, 'Create')
);
}

if (list.graphql.isEnabled.update) {
interimCreateUpdateTypes.push(
printInterimType(list, listKey, gqlNames.updateInputName, 'Update')
);
}

listsTypeInfo.push(` readonly ${listKey}: ${listTypeInfoName};`);
listsNamespaces.push(printListTypeInfo(listKey, list));
Expand Down

1 comment on commit 7c723d9

@vercel
Copy link

@vercel vercel bot commented on 7c723d9 Jan 17, 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.