Skip to content

Commit 485a284

Browse files
committed
fix: allow pass FieldConfig.type as a Thunk (function) without Error
1 parent 53751f0 commit 485a284

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
2-
type: 'Boolean',
2+
type: (sc) => sc.get('Boolean'),
33
resolve: () => true,
44
};

src/astToSchema.ts

+3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ function isSomeOutputTypeDefinition(type: any): boolean {
224224
} else if (Array.isArray(type)) {
225225
// type: ['String']
226226
return isSomeOutputTypeDefinition(type[0]);
227+
} else if (isFunction(type)) {
228+
// pass thunked type without internal checks
229+
return true;
227230
} else {
228231
// type: 'type User { name: String }'
229232
return isComposeOutputType(type);

0 commit comments

Comments
 (0)