From dc050f4d70ebee380d3533d570099f99ebdafa37 Mon Sep 17 00:00:00 2001 From: Mussie Teshome Date: Mon, 26 Jun 2023 14:23:40 +0300 Subject: [PATCH] forgot_password and reset_password query update --- server/graph/generated/generated.go | 29 +++++++++++++++++++---------- server/graph/schema.graphqls | 5 +++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/server/graph/generated/generated.go b/server/graph/generated/generated.go index e849306..a9fd4e8 100644 --- a/server/graph/generated/generated.go +++ b/server/graph/generated/generated.go @@ -2577,15 +2577,16 @@ input UpdateUserInput { } input ForgotPasswordInput { - email: String! + email_or_phone: String! state: String redirect_uri: String } input ResetPasswordInput { - token: String! + token_or_code: String! password: String! confirm_password: String! + phone_number: String } input DeleteUserInput { @@ -15726,18 +15727,18 @@ func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Contex asMap[k] = v } - fieldsInOrder := [...]string{"email", "state", "redirect_uri"} + fieldsInOrder := [...]string{"email_or_phone", "state", "redirect_uri"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "email": + case "email_or_phone": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) - it.Email, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email_or_phone")) + it.EmailOrPhone, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -16406,18 +16407,18 @@ func (ec *executionContext) unmarshalInputResetPasswordInput(ctx context.Context asMap[k] = v } - fieldsInOrder := [...]string{"token", "password", "confirm_password"} + fieldsInOrder := [...]string{"token_or_code", "password", "confirm_password", "phone_number"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "token": + case "token_or_code": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("token")) - it.Token, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("token_or_code")) + it.TokenOrCode, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -16437,6 +16438,14 @@ func (ec *executionContext) unmarshalInputResetPasswordInput(ctx context.Context if err != nil { return it, err } + case "phone_number": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phone_number")) + it.PhoneNumber, err = ec.unmarshalOString2áš–string(ctx, v) + if err != nil { + return it, err + } } } diff --git a/server/graph/schema.graphqls b/server/graph/schema.graphqls index 4013b12..7ebd0c2 100644 --- a/server/graph/schema.graphqls +++ b/server/graph/schema.graphqls @@ -418,15 +418,16 @@ input UpdateUserInput { } input ForgotPasswordInput { - email: String! + email_or_phone: String! state: String redirect_uri: String } input ResetPasswordInput { - token: String! + token_or_code: String! password: String! confirm_password: String! + phone_number: String } input DeleteUserInput {