Skip to content

Commit 31507e2

Browse files
committed
fix: Bug where enum was ignored in return type builders
1 parent eb2e795 commit 31507e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/GenerateCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ export default class GenerateCommand {
209209
.map((f) => ({ name: f.name, info: this.returnTypeInfo(f.type) }))
210210
.filter((f): f is { name: string; info: ReturnTypeInfo } => !!f.info);
211211

212-
let scalarProperties = returnTypes.filter((t) => t.info.kind == "scalar").map((t) => t.name);
212+
let scalarProperties = returnTypes.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1);
213213

214214
yield fillStub("ReturnTypeBuilder", {
215215
SCALARPROPERTYLITERALS:
216216
returnTypes
217-
.filter((t) => t.info.kind == "scalar")
217+
.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1)
218218
.map((t) => JSON.stringify(t.name))
219219
.join("|") || "never",
220220
SCALARPROPERTYARRAY: scalarProperties.length > 0 ? JSON.stringify(scalarProperties) : "",

0 commit comments

Comments
 (0)