Skip to content

Commit 6e464f8

Browse files
committed
refactor: use import type when possible
1 parent de8e6b2 commit 6e464f8

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
coverage/
44
.husky/_/
55
pnpm-lock.yaml
6+
vendor/common

codegen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ const config: CodegenConfig = {
44
overwrite: true,
55
schema: 'lib/graphql/schema.graphql',
66
config: {
7+
// strictScalars: true,
8+
// noSchemaStitching: false,
9+
useTypeImports: true,
710
contextType: '@app/lib/graphql/context.ts#Context',
811
},
912
generates: {
1013
'lib/graphql/__generated__/resolvers.ts': {
1114
plugins: ['typescript', 'typescript-resolvers'],
15+
config: {
16+
// defaultMapper: 'DeepPartial<{T}>',
17+
},
1218
},
1319
// "./graphql.schema.json": {
1420
// plugins: ["introspection"]

lib/graphql/__generated__/resolvers.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/graphql/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const resolvers = {
8585
},
8686

8787
Subject: {
88-
tags(parent, { limit }): types.SubjectTag[] {
88+
tags(parent: types.Subject, { limit }): types.SubjectTag[] {
8989
if (limit && limit > 0) {
9090
return parent.tags.slice(0, limit);
9191
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"strictNullChecks": true,
1717
"allowImportingTsExtensions": true,
1818
"forceConsistentCasingInFileNames": true,
19-
"verbatimModuleSyntax": false,
19+
"verbatimModuleSyntax": true,
2020
"pretty": true,
2121
"sourceMap": false,
2222
"declaration": false,

0 commit comments

Comments
 (0)