[server] add ability to get user by email

This commit is contained in:
Lakhan Samani
2023-05-20 09:49:18 +05:30
parent 4e7074d75b
commit 930c934fdb
5 changed files with 63 additions and 17 deletions

View File

@@ -2630,7 +2630,8 @@ input ResendOTPRequest {
}
input GetUserRequest {
id: String!
id: String
email: String
}
type Mutation {
@@ -15369,7 +15370,7 @@ func (ec *executionContext) unmarshalInputGetUserRequest(ctx context.Context, ob
asMap[k] = v
}
fieldsInOrder := [...]string{"id"}
fieldsInOrder := [...]string{"id", "email"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
@@ -15380,7 +15381,15 @@ func (ec *executionContext) unmarshalInputGetUserRequest(ctx context.Context, ob
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
it.ID, err = ec.unmarshalNString2string(ctx, v)
it.ID, err = ec.unmarshalOString2string(ctx, v)
if err != nil {
return it, err
}
case "email":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
it.Email, err = ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}