@@ -201,6 +201,7 @@ export class Authorizer {
201201 variables : {
202202 data,
203203 } ,
204+ operationName : 'forgotPassword' ,
204205 } ) ;
205206 return forgotPasswordResp ?. errors ?. length
206207 ? this . errorResponse ( forgotPasswordResp . errors )
@@ -214,7 +215,8 @@ export class Authorizer {
214215 try {
215216 const res = await this . graphqlQuery ( {
216217 query :
217- 'query { meta { version client_id is_google_login_enabled is_facebook_login_enabled is_github_login_enabled is_linkedin_login_enabled is_apple_login_enabled is_twitter_login_enabled is_microsoft_login_enabled is_twitch_login_enabled is_roblox_login_enabled is_email_verification_enabled is_basic_authentication_enabled is_magic_link_login_enabled is_sign_up_enabled is_strong_password_enabled is_multi_factor_auth_enabled is_mobile_basic_authentication_enabled is_phone_verification_enabled } }' ,
218+ 'query meta { meta { version client_id is_google_login_enabled is_facebook_login_enabled is_github_login_enabled is_linkedin_login_enabled is_apple_login_enabled is_twitter_login_enabled is_microsoft_login_enabled is_twitch_login_enabled is_roblox_login_enabled is_email_verification_enabled is_basic_authentication_enabled is_magic_link_login_enabled is_sign_up_enabled is_strong_password_enabled is_multi_factor_auth_enabled is_mobile_basic_authentication_enabled is_phone_verification_enabled } }' ,
219+ operationName : 'meta' ,
218220 } ) ;
219221
220222 return res ?. errors ?. length
@@ -230,8 +232,9 @@ export class Authorizer {
230232 ) : Promise < Types . ApiResponse < Types . User > > => {
231233 try {
232234 const profileRes = await this . graphqlQuery ( {
233- query : `query { profile { ${ userFragment } } }` ,
235+ query : `query profile { profile { ${ userFragment } } }` ,
234236 headers,
237+ operationName : 'profile' ,
235238 } ) ;
236239
237240 return profileRes ?. errors ?. length
@@ -254,6 +257,7 @@ export class Authorizer {
254257 variables : {
255258 params,
256259 } ,
260+ operationName : 'getSession' ,
257261 } ) ;
258262 return res ?. errors ?. length
259263 ? this . errorResponse ( res . errors )
@@ -336,6 +340,7 @@ export class Authorizer {
336340 mutation login($data: LoginRequest!) { login(params: $data) { ${ authTokenFragment } }}
337341 ` ,
338342 variables : { data } ,
343+ operationName : 'login' ,
339344 } ) ;
340345
341346 return res ?. errors ?. length
@@ -351,8 +356,9 @@ export class Authorizer {
351356 ) : Promise < Types . ApiResponse < Types . GenericResponse > > => {
352357 try {
353358 const res = await this . graphqlQuery ( {
354- query : ' mutation { logout { message } } ' ,
359+ query : 'mutation logout { logout { message } }' ,
355360 headers,
361+ operationName : 'logout' ,
356362 } ) ;
357363 return res ?. errors ?. length
358364 ? this . errorResponse ( res . errors )
@@ -375,6 +381,7 @@ export class Authorizer {
375381 mutation magicLinkLogin($data: MagicLinkLoginRequest!) { magic_link_login(params: $data) { message }}
376382 ` ,
377383 variables : { data } ,
384+ operationName : 'magicLinkLogin' ,
378385 } ) ;
379386
380387 return res ?. errors ?. length
@@ -423,6 +430,7 @@ export class Authorizer {
423430 mutation resendOtp($data: ResendOTPRequest!) { resend_otp(params: $data) { message }}
424431 ` ,
425432 variables : { data } ,
433+ operationName : 'resendOtp' ,
426434 } ) ;
427435
428436 return res ?. errors ?. length
@@ -443,6 +451,7 @@ export class Authorizer {
443451 variables : {
444452 data,
445453 } ,
454+ operationName : 'resetPassword' ,
446455 } ) ;
447456 return resetPasswordRes ?. errors ?. length
448457 ? this . errorResponse ( resetPasswordRes . errors )
@@ -516,6 +525,7 @@ export class Authorizer {
516525 mutation signup($data: SignUpRequest!) { signup(params: $data) { ${ authTokenFragment } }}
517526 ` ,
518527 variables : { data } ,
528+ operationName : 'signup' ,
519529 } ) ;
520530
521531 return res ?. errors ?. length
@@ -538,6 +548,7 @@ export class Authorizer {
538548 variables : {
539549 data,
540550 } ,
551+ operationName : 'updateProfile' ,
541552 } ) ;
542553
543554 return updateProfileRes ?. errors ?. length
@@ -555,6 +566,7 @@ export class Authorizer {
555566 const res = await this . graphqlQuery ( {
556567 query : 'mutation deactivateAccount { deactivate_account { message } }' ,
557568 headers,
569+ operationName : 'deactivateAccount' ,
558570 } ) ;
559571 return res ?. errors ?. length
560572 ? this . errorResponse ( res . errors )
@@ -574,6 +586,7 @@ export class Authorizer {
574586 variables : {
575587 params,
576588 } ,
589+ operationName : 'validateJWTToken' ,
577590 } ) ;
578591
579592 return res ?. errors ?. length
@@ -593,6 +606,7 @@ export class Authorizer {
593606 variables : {
594607 params,
595608 } ,
609+ operationName : 'validateSession' ,
596610 } ) ;
597611
598612 return res ?. errors ?. length
@@ -612,6 +626,7 @@ export class Authorizer {
612626 mutation verifyEmail($data: VerifyEmailRequest!) { verify_email(params: $data) { ${ authTokenFragment } }}
613627 ` ,
614628 variables : { data } ,
629+ operationName : 'verifyEmail' ,
615630 } ) ;
616631
617632 return res ?. errors ?. length
@@ -631,6 +646,7 @@ export class Authorizer {
631646 mutation resendVerifyEmail($data: ResendVerifyEmailRequest!) { resend_verify_email(params: $data) { message }}
632647 ` ,
633648 variables : { data } ,
649+ operationName : 'resendVerifyEmail' ,
634650 } ) ;
635651
636652 return res ?. errors ?. length
@@ -650,6 +666,7 @@ export class Authorizer {
650666 mutation verifyOtp($data: VerifyOTPRequest!) { verify_otp(params: $data) { ${ authTokenFragment } }}
651667 ` ,
652668 variables : { data } ,
669+ operationName : 'verifyOtp' ,
653670 } ) ;
654671
655672 return res ?. errors ?. length
@@ -666,12 +683,16 @@ export class Authorizer {
666683 data : Types . GraphqlQueryRequest ,
667684 ) : Promise < Types . GrapQlResponseType > => {
668685 const fetcher = getFetcher ( ) ;
686+ const body : Record < string , unknown > = {
687+ query : data . query ,
688+ variables : data . variables || { } ,
689+ } ;
690+ if ( data . operationName ) {
691+ body . operationName = data . operationName ;
692+ }
669693 const res = await fetcher ( `${ this . config . authorizerURL } /graphql` , {
670694 method : 'POST' ,
671- body : JSON . stringify ( {
672- query : data . query ,
673- variables : data . variables || { } ,
674- } ) ,
695+ body : JSON . stringify ( body ) ,
675696 headers : {
676697 ...this . config . extraHeaders ,
677698 ...( data . headers || { } ) ,
0 commit comments