@@ -38,28 +38,25 @@ export function prepareCommonOpts<TContext>(
38
38
schemaComposer ,
39
39
getOrCreateOTC : ( typeName , cfgOrThunk ) => {
40
40
return schemaComposer . getOrSet ( typeName , ( ) => {
41
- const tc = schemaComposer . createObjectTC ( typeName ) ;
42
- const cfg = isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk ;
43
- tc . setFields ( cfg . fields ) ;
44
- tc . setDescription ( cfg . description ) ;
41
+ const tc = schemaComposer . createObjectTC (
42
+ isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk
43
+ ) ;
45
44
return tc ;
46
45
} ) ;
47
46
} ,
48
47
getOrCreateITC : ( typeName , cfgOrThunk ) = > {
49
48
return schemaComposer . getOrSet ( typeName , ( ) => {
50
- const tc = schemaComposer . createInputTC ( typeName ) ;
51
- const cfg = isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk ;
52
- tc . setFields ( cfg . fields ) ;
53
- tc . setDescription ( cfg . description ) ;
49
+ const tc = schemaComposer . createInputTC (
50
+ isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk
51
+ ) ;
54
52
return tc ;
55
53
} ) ;
56
54
} ,
57
55
getOrCreateETC : ( typeName , cfgOrThunk ) = > {
58
56
return schemaComposer . getOrSet ( typeName , ( ) => {
59
- const tc = schemaComposer . createEnumTC ( typeName ) ;
60
- const cfg = isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk ;
61
- tc . setFields ( cfg . values ) ;
62
- tc . setDescription ( cfg . description ) ;
57
+ const tc = schemaComposer . createEnumTC (
58
+ isFunction ( cfgOrThunk ) ? ( cfgOrThunk : any ) ( ) : cfgOrThunk
59
+ ) ;
63
60
return tc ;
64
61
} ) ;
65
62
} ,
0 commit comments