From 72cc9445b55cc0caf85f9a1810aaedaed286afa3 Mon Sep 17 00:00:00 2001 From: Alexandre Villeneuve Date: Tue, 22 Jun 2021 14:18:09 -0400 Subject: [PATCH] fix: list def typing (#77) Co-authored-by: Jason Kuhrt --- src/generator/models/declaration.ts | 4 ++-- .../__snapshots__/modelRelationFields.test.ts.snap | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generator/models/declaration.ts b/src/generator/models/declaration.ts index efd9ec4e8..c958c4f43 100644 --- a/src/generator/models/declaration.ts +++ b/src/generator/models/declaration.ts @@ -212,11 +212,11 @@ function renderNexusType2(field: DMMF.Field, settings: Gentime.Settings): string if (field.isList && field.isRequired) { return dedent` - NexusCore.ListDef<${graphqlType}> | NexusCore.NexusNonNullDef<${graphqlType}> + NexusCore.NexusListDef<${graphqlType}> | NexusCore.NexusNonNullDef<${graphqlType}> ` } else if (field.isList && !field.isRequired) { return dedent` - NexusCore.ListDef<${graphqlType}> | NexusCore.NexusNullDef<${graphqlType}> + NexusCore.NexusListDef<${graphqlType}> | NexusCore.NexusNullDef<${graphqlType}> ` } else if (field.isRequired) { return dedent` diff --git a/tests/unit/typescriptDeclarationFile/__snapshots__/modelRelationFields.test.ts.snap b/tests/unit/typescriptDeclarationFile/__snapshots__/modelRelationFields.test.ts.snap index b94041259..6df365b60 100644 --- a/tests/unit/typescriptDeclarationFile/__snapshots__/modelRelationFields.test.ts.snap +++ b/tests/unit/typescriptDeclarationFile/__snapshots__/modelRelationFields.test.ts.snap @@ -140,7 +140,7 @@ declare namespace $Types { /** * The type of this field. */ - type: NexusCore.ListDef | NexusCore.NexusNonNullDef + type: NexusCore.NexusListDef | NexusCore.NexusNonNullDef /** * The documentation of this field.