Skip to content

Commit 50bd7e5

Browse files
committed
fix: Scalar Properties rendering full type definition instead of just the name
1 parent c0911dc commit 50bd7e5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fetch-depth: 0
2828
- uses: actions/setup-node@v2
2929
with:
30-
node-version: "16.x"
30+
node-version: "16"
3131
registry-url: "https://registry.yarnpkg.com"
3232

3333
- name: Setup registries

src/commands/GenerateCommand.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default class GenerateCommand {
110110
compilerOptions: {
111111
target: ts.ScriptTarget.ESNext,
112112
module: ts.ModuleKind.ESNext,
113-
moduleResolution: ts.ModuleResolutionKind.Node12,
113+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
114114
esModuleInterop: true,
115115
forceConsistentCasingInFileNames: true,
116116
strict: true,
@@ -146,7 +146,9 @@ export default class GenerateCommand {
146146
const returnTypes = (type.fields || [])
147147
.map((f) => ({ name: f.name, info: this.returnTypeInfo(f.type) }))
148148
.filter((f) => !!f.info);
149-
let scalarProperties = returnTypes.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1);
149+
let scalarProperties = returnTypes
150+
.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1)
151+
.map((sp) => sp.name);
150152
yield fillStub("ReturnTypeBuilder", {
151153
SCALARPROPERTYLITERALS: returnTypes
152154
.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1)

src/commands/GenerateCommand.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default class GenerateCommand {
166166
compilerOptions: {
167167
target: ts.ScriptTarget.ESNext,
168168
module: ts.ModuleKind.ESNext,
169-
moduleResolution: ts.ModuleResolutionKind.Node12,
169+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
170170
esModuleInterop: true,
171171
forceConsistentCasingInFileNames: true,
172172
strict: true,
@@ -209,7 +209,9 @@ 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) => ["scalar", "enum"].indexOf(t.info.kind) > -1);
212+
let scalarProperties = returnTypes
213+
.filter((t) => ["scalar", "enum"].indexOf(t.info.kind) > -1)
214+
.map((sp) => sp.name);
213215

214216
yield fillStub("ReturnTypeBuilder", {
215217
SCALARPROPERTYLITERALS:

0 commit comments

Comments
 (0)