@@ -279,21 +279,30 @@ export const Gql = Chain(HOST, {
279
279
280
280
export const ZeusScalars = ZeusSelect < ScalarCoders > ( ) ;
281
281
282
+ type BaseSymbol = number | string | undefined | boolean | null ;
283
+
282
284
type ScalarsSelector < T > = {
283
285
[ X in Required < {
284
- [ P in keyof T ] : T [ P ] extends number | string | undefined | boolean ? P : never ;
286
+ [ P in keyof T ] : T [ P ] extends BaseSymbol | Array < BaseSymbol > ? P : never ;
285
287
} > [ keyof T ] ] : true ;
286
288
} ;
287
289
288
290
export const fields = < T extends keyof ModelTypes > ( k : T ) => {
289
291
const t = ReturnTypes [ k ] ;
292
+ const fnType = k in AllTypesProps ? AllTypesProps [ k as keyof typeof AllTypesProps ] : undefined ;
293
+ const hasFnTypes = typeof fnType === 'object' ? fnType : undefined ;
290
294
const o = Object . fromEntries (
291
295
Object . entries ( t )
292
- . filter ( ( [ , value ] ) => {
296
+ . filter ( ( [ k , value ] ) => {
297
+ const isFunctionType = hasFnTypes && k in hasFnTypes && ! ! hasFnTypes [ k as keyof typeof hasFnTypes ] ;
298
+ if ( isFunctionType ) return false ;
293
299
const isReturnType = ReturnTypes [ value as string ] ;
294
- if ( ! isReturnType || ( typeof isReturnType === 'string' && isReturnType . startsWith ( 'scalar.' ) ) ) {
300
+ if ( ! isReturnType ) return true ;
301
+ if ( typeof isReturnType !== 'string' ) return false ;
302
+ if ( isReturnType . startsWith ( 'scalar.' ) ) {
295
303
return true ;
296
304
}
305
+ return false ;
297
306
} )
298
307
. map ( ( [ key ] ) => [ key , true as const ] ) ,
299
308
) ;
@@ -949,6 +958,7 @@ attack?: [{ /** Attacked card/card ids<br> */
949
958
/** The name of a card<br> */
950
959
name ?:boolean | `@${string } `,
951
960
skills ?:boolean | `@${string } `,
961
+ testFn ?: [ { test ?: string | undefined | null | Variable < any , string > } , boolean | `@${string } `] ,
952
962
__typename ?: boolean | `@${string } `
953
963
} > ;
954
964
[ "SpecialCard" ] : AliasType < {
@@ -1054,6 +1064,7 @@ attack?: [{ /** Attacked card/card ids<br> */
1054
1064
/** The name of a card<br> */
1055
1065
name ?:boolean | `@${string } `,
1056
1066
skills ?:boolean | `@${string } `,
1067
+ testFn ?: [ { test ?: string | undefined | null } , boolean | `@${string } `] ,
1057
1068
__typename ?: boolean | `@${string } `
1058
1069
} > ;
1059
1070
[ "SpecialCard" ] : AliasType < {
@@ -1156,7 +1167,8 @@ export type ModelTypes = {
1156
1167
info : ModelTypes [ "JSON" ] ,
1157
1168
/** The name of a card<br> */
1158
1169
name : string ,
1159
- skills ?: Array < ModelTypes [ "SpecialSkills" ] > | undefined | null
1170
+ skills ?: Array < ModelTypes [ "SpecialSkills" ] > | undefined | null ,
1171
+ testFn ?: string | undefined | null
1160
1172
} ;
1161
1173
[ "SpecialCard" ] : {
1162
1174
effect : string ,
@@ -1257,7 +1269,8 @@ export type GraphQLTypes = {
1257
1269
info : GraphQLTypes [ "JSON" ] ,
1258
1270
/** The name of a card<br> */
1259
1271
name : string ,
1260
- skills ?: Array < GraphQLTypes [ "SpecialSkills" ] > | undefined | null
1272
+ skills ?: Array < GraphQLTypes [ "SpecialSkills" ] > | undefined | null ,
1273
+ testFn ?: string | undefined | null
1261
1274
} ;
1262
1275
[ "SpecialCard" ] : {
1263
1276
__typename : "SpecialCard" ,
0 commit comments