@@ -165,7 +165,10 @@ export const Thunder =
165
165
operation : O ,
166
166
graphqlOptions ?: ThunderGraphQLOptions < SCLR > ,
167
167
) =>
168
- < Z extends ValueTypes [ R ] > ( o : Z | ValueTypes [ R ] , ops ?: OperationOptions & { variables ?: Record < string , unknown > } ) =>
168
+ < Z extends ValueTypes [ R ] > (
169
+ o : ( Z & ValueTypes [ R ] ) | ValueTypes [ R ] ,
170
+ ops ?: OperationOptions & { variables ?: Record < string , unknown > } ,
171
+ ) =>
169
172
fn (
170
173
Zeus ( operation , o , {
171
174
operationOptions : ops ,
@@ -194,7 +197,10 @@ export const SubscriptionThunder =
194
197
operation : O ,
195
198
graphqlOptions ?: ThunderGraphQLOptions < SCLR > ,
196
199
) =>
197
- < Z extends ValueTypes [ R ] > ( o : Z | ValueTypes [ R ] , ops ?: OperationOptions & { variables ?: ExtractVariables < Z > } ) => {
200
+ < Z extends ValueTypes [ R ] > (
201
+ o : ( Z & ValueTypes [ R ] ) | ValueTypes [ R ] ,
202
+ ops ?: OperationOptions & { variables ?: ExtractVariables < Z > } ,
203
+ ) => {
198
204
const returnedFunction = fn (
199
205
Zeus ( operation , o , {
200
206
operationOptions : ops ,
@@ -230,7 +236,7 @@ export const Zeus = <
230
236
R extends keyof ValueTypes = GenericOperation < O > ,
231
237
> (
232
238
operation : O ,
233
- o : Z | ValueTypes [ R ] ,
239
+ o : ( Z & ValueTypes [ R ] ) | ValueTypes [ R ] ,
234
240
ops ?: {
235
241
operationOptions ?: OperationOptions ;
236
242
scalars ?: ScalarDefinition ;
@@ -700,7 +706,7 @@ type IsInterfaced<SRC extends DeepAnify<DST>, DST, SCLR extends ScalarDefinition
700
706
[ P in keyof SRC ] : SRC [ P ] extends '__union' & infer R
701
707
? P extends keyof DST
702
708
? IsArray < R , '__typename' extends keyof DST ? DST [ P ] & { __typename : true } : DST [ P ] , SCLR >
703
- : IsArray < R , '__typename' extends keyof DST ? { __typename : true } : never , SCLR >
709
+ : IsArray < R , '__typename' extends keyof DST ? { __typename : true } : Record < string , never > , SCLR >
704
710
: never ;
705
711
} [ keyof SRC ] & {
706
712
[ P in keyof Omit <
@@ -810,11 +816,18 @@ export type Variable<T extends GraphQLVariableType, Name extends string> = {
810
816
' __zeus_type' : T ;
811
817
} ;
812
818
819
+ export type ExtractVariablesDeep < Query > = Query extends Variable < infer VType , infer VName >
820
+ ? { [ key in VName ] : GetVariableType < VType > }
821
+ : Query extends string | number | boolean | Array < string | number | boolean >
822
+ ? // eslint-disable-next-line @typescript-eslint/ban-types
823
+ { }
824
+ : UnionToIntersection < { [ K in keyof Query ] : WithOptionalNullables < ExtractVariablesDeep < Query [ K ] > > } [ keyof Query ] > ;
825
+
813
826
export type ExtractVariables < Query > = Query extends Variable < infer VType , infer VName >
814
827
? { [ key in VName ] : GetVariableType < VType > }
815
828
: Query extends [ infer Inputs , infer Outputs ]
816
- ? ExtractVariables < Inputs > & ExtractVariables < Outputs >
817
- : Query extends string | number | boolean
829
+ ? ExtractVariablesDeep < Inputs > & ExtractVariables < Outputs >
830
+ : Query extends string | number | boolean | Array < string | number | boolean >
818
831
? // eslint-disable-next-line @typescript-eslint/ban-types
819
832
{ }
820
833
: UnionToIntersection < { [ K in keyof Query ] : WithOptionalNullables < ExtractVariables < Query [ K ] > > } [ keyof Query ] > ;
@@ -867,9 +880,16 @@ registerService?: [{ input: ValueTypes["RegisterServiceInput"] | Variable<any, s
867
880
updateService ?: [ { input : Array < ValueTypes [ "UpdateServiceInput" ] > | Variable < any , string > } , ValueTypes [ "UpdateServiceRespond" ] ] ,
868
881
removeService ?: [ { serviceId : string | Variable < any , string > } , ValueTypes [ "RemoveServiceRespond" ] ] ,
869
882
bookService ?: [ { input : ValueTypes [ "BookServiceInput" ] | Variable < any , string > } , ValueTypes [ "BookServiceRespond" ] ] ,
883
+ send ?: [ { mailgunData : ValueTypes [ "MailgunData" ] | Variable < any , string > } , boolean | `@${string } `] ,
870
884
respondOnServiceRequest ?: [ { input : ValueTypes [ "RespondOnServiceRequestInput" ] | Variable < any , string > } , ValueTypes [ "RespondOnServiceRequestRespond" ] ] ,
871
885
__typename ?: boolean | `@${string } `
872
886
} > ;
887
+ [ "MailgunData" ] : {
888
+ to : string | Variable < any , string > ,
889
+ subject : string | Variable < any , string > ,
890
+ message : string | Variable < any , string > ,
891
+ from ?: string | undefined | null | Variable < any , string >
892
+ } ;
873
893
[ "GetBookingsForServiceInput" ] : {
874
894
page ?: ValueTypes [ "PageOptionsInput" ] | undefined | null | Variable < any , string > ,
875
895
filters ?: ValueTypes [ "GetBookingsForServiceFiltersInput" ] | undefined | null | Variable < any , string >
@@ -980,7 +1000,7 @@ respondOnServiceRequest?: [{ input: ValueTypes["RespondOnServiceRequestInput"] |
980
1000
comments ?: string | undefined | null | Variable < any , string >
981
1001
} ;
982
1002
[ "BookServiceRespond" ] : AliasType < {
983
- books ?:ValueTypes [ "BookingRecord" ] ,
1003
+ book ?:ValueTypes [ "BookingRecord" ] ,
984
1004
error ?:ValueTypes [ "GlobalError" ] ,
985
1005
__typename ?: boolean | `@${string } `
986
1006
} > ;
@@ -1006,7 +1026,7 @@ respondOnServiceRequest?: [{ input: ValueTypes["RespondOnServiceRequestInput"] |
1006
1026
} > ;
1007
1027
[ "BookingRecord" ] : AliasType < {
1008
1028
bookerId ?:boolean | `@${string } `,
1009
- service ?:ValueTypes [ "Service" ] ,
1029
+ services ?:ValueTypes [ "Service" ] ,
1010
1030
comments ?:boolean | `@${string } `,
1011
1031
_id ?:boolean | `@${string } `,
1012
1032
createdAt ?:boolean | `@${string } `,
@@ -1082,9 +1102,16 @@ registerService?: [{ input: ResolverInputTypes["RegisterServiceInput"]},Resolver
1082
1102
updateService ?: [ { input : Array < ResolverInputTypes [ "UpdateServiceInput" ] > } , ResolverInputTypes [ "UpdateServiceRespond" ] ] ,
1083
1103
removeService ?: [ { serviceId : string } , ResolverInputTypes [ "RemoveServiceRespond" ] ] ,
1084
1104
bookService ?: [ { input : ResolverInputTypes [ "BookServiceInput" ] } , ResolverInputTypes [ "BookServiceRespond" ] ] ,
1105
+ send ?: [ { mailgunData : ResolverInputTypes [ "MailgunData" ] } , boolean | `@${string } `] ,
1085
1106
respondOnServiceRequest ?: [ { input : ResolverInputTypes [ "RespondOnServiceRequestInput" ] } , ResolverInputTypes [ "RespondOnServiceRequestRespond" ] ] ,
1086
1107
__typename ?: boolean | `@${string } `
1087
1108
} > ;
1109
+ [ "MailgunData" ] : {
1110
+ to : string ,
1111
+ subject : string ,
1112
+ message : string ,
1113
+ from ?: string | undefined | null
1114
+ } ;
1088
1115
[ "GetBookingsForServiceInput" ] : {
1089
1116
page ?: ResolverInputTypes [ "PageOptionsInput" ] | undefined | null ,
1090
1117
filters ?: ResolverInputTypes [ "GetBookingsForServiceFiltersInput" ] | undefined | null
@@ -1195,7 +1222,7 @@ respondOnServiceRequest?: [{ input: ResolverInputTypes["RespondOnServiceRequestI
1195
1222
comments ?: string | undefined | null
1196
1223
} ;
1197
1224
[ "BookServiceRespond" ] : AliasType < {
1198
- books ?:ResolverInputTypes [ "BookingRecord" ] ,
1225
+ book ?:ResolverInputTypes [ "BookingRecord" ] ,
1199
1226
error ?:ResolverInputTypes [ "GlobalError" ] ,
1200
1227
__typename ?: boolean | `@${string } `
1201
1228
} > ;
@@ -1221,7 +1248,7 @@ respondOnServiceRequest?: [{ input: ResolverInputTypes["RespondOnServiceRequestI
1221
1248
} > ;
1222
1249
[ "BookingRecord" ] : AliasType < {
1223
1250
bookerId ?:boolean | `@${string } `,
1224
- service ?:ResolverInputTypes [ "Service" ] ,
1251
+ services ?:ResolverInputTypes [ "Service" ] ,
1225
1252
comments ?:boolean | `@${string } `,
1226
1253
_id ?:boolean | `@${string } `,
1227
1254
createdAt ?:boolean | `@${string } `,
@@ -1301,7 +1328,14 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1301
1328
updateService : ModelTypes [ "UpdateServiceRespond" ] ,
1302
1329
removeService : ModelTypes [ "RemoveServiceRespond" ] ,
1303
1330
bookService : ModelTypes [ "BookServiceRespond" ] ,
1331
+ send ?: string | undefined ,
1304
1332
respondOnServiceRequest : ModelTypes [ "RespondOnServiceRequestRespond" ]
1333
+ } ;
1334
+ [ "MailgunData" ] : {
1335
+ to : string ,
1336
+ subject : string ,
1337
+ message : string ,
1338
+ from ?: string | undefined
1305
1339
} ;
1306
1340
[ "GetBookingsForServiceInput" ] : {
1307
1341
page ?: ModelTypes [ "PageOptionsInput" ] | undefined ,
@@ -1404,7 +1438,7 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1404
1438
comments ?: string | undefined
1405
1439
} ;
1406
1440
[ "BookServiceRespond" ] : {
1407
- books ?: Array < ModelTypes [ "BookingRecord" ] > | undefined ,
1441
+ book : ModelTypes [ "BookingRecord" ] ,
1408
1442
error ?: ModelTypes [ "GlobalError" ] | undefined
1409
1443
} ;
1410
1444
[ "UserServiceRespond" ] : {
@@ -1427,7 +1461,7 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1427
1461
} ;
1428
1462
[ "BookingRecord" ] : {
1429
1463
bookerId : string ,
1430
- service : ModelTypes [ "Service" ] ,
1464
+ services ?: Array < ModelTypes [ "Service" ] > | undefined ,
1431
1465
comments ?: string | undefined ,
1432
1466
_id : string ,
1433
1467
createdAt : ModelTypes [ "Date" ] ,
@@ -1503,7 +1537,14 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1503
1537
updateService : GraphQLTypes [ "UpdateServiceRespond" ] ,
1504
1538
removeService : GraphQLTypes [ "RemoveServiceRespond" ] ,
1505
1539
bookService : GraphQLTypes [ "BookServiceRespond" ] ,
1540
+ send ?: string | undefined ,
1506
1541
respondOnServiceRequest : GraphQLTypes [ "RespondOnServiceRequestRespond" ]
1542
+ } ;
1543
+ [ "MailgunData" ] : {
1544
+ to : string ,
1545
+ subject : string ,
1546
+ message : string ,
1547
+ from ?: string | undefined
1507
1548
} ;
1508
1549
[ "GetBookingsForServiceInput" ] : {
1509
1550
page ?: GraphQLTypes [ "PageOptionsInput" ] | undefined ,
@@ -1616,7 +1657,7 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1616
1657
} ;
1617
1658
[ "BookServiceRespond" ] : {
1618
1659
__typename : "BookServiceRespond" ,
1619
- books ?: Array < GraphQLTypes [ "BookingRecord" ] > | undefined ,
1660
+ book : GraphQLTypes [ "BookingRecord" ] ,
1620
1661
error ?: GraphQLTypes [ "GlobalError" ] | undefined
1621
1662
} ;
1622
1663
[ "UserServiceRespond" ] : {
@@ -1642,7 +1683,7 @@ in otherwise any endpoint in UserMutation will throw error about malformed sourc
1642
1683
[ "BookingRecord" ] : {
1643
1684
__typename : "BookingRecord" ,
1644
1685
bookerId : string ,
1645
- service : GraphQLTypes [ "Service" ] ,
1686
+ services ?: Array < GraphQLTypes [ "Service" ] > | undefined ,
1646
1687
comments ?: string | undefined ,
1647
1688
_id : string ,
1648
1689
createdAt : GraphQLTypes [ "Date" ] ,
@@ -1693,6 +1734,7 @@ export const enum ServiceType {
1693
1734
}
1694
1735
1695
1736
type ZEUS_VARIABLES = {
1737
+ [ "MailgunData" ] : ValueTypes [ "MailgunData" ] ;
1696
1738
[ "GetBookingsForServiceInput" ] : ValueTypes [ "GetBookingsForServiceInput" ] ;
1697
1739
[ "GetBookingsForServiceFiltersInput" ] : ValueTypes [ "GetBookingsForServiceFiltersInput" ] ;
1698
1740
[ "RespondOnServiceRequestInput" ] : ValueTypes [ "RespondOnServiceRequestInput" ] ;
0 commit comments