diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 2caaae8aa4..bfaaac5ee7 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -8806,17 +8806,40 @@ type IdentityVerificationEdge { } type IdentityVerificationEmail { + created_at( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See + # http://www.iana.org/time-zones, + # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + + # Email of the identity verification's owner + email: String + # A globally unique ID. id: ID! # A type-specific ID likely used as a database ID. internalID: ID! + # Name of the identity verification's owner + name: String + # Identity verification lifecycle state state: String! + updated_at( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See + # http://www.iana.org/time-zones, + # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String # User ID of the identity verification's owner - userID: String! + userID: String } type IdentityVerificationEmailMutationFailureType { @@ -13748,6 +13771,11 @@ union SendFeedbackMutationType = input SendIdentityVerificationEmailMutationInput { clientMutationId: String + + # The email for the user undergoing identity verificaiton + email: String + + # The user Id for the user undergoing identity verificaiton userID: String } diff --git a/src/schema/v2/me/sendIdentityVerficationEmailMutation.ts b/src/schema/v2/me/sendIdentityVerficationEmailMutation.ts index a7c55c1bca..85611adc14 100644 --- a/src/schema/v2/me/sendIdentityVerficationEmailMutation.ts +++ b/src/schema/v2/me/sendIdentityVerficationEmailMutation.ts @@ -11,6 +11,7 @@ import { formatGravityError, } from "lib/gravityErrorHandler" import { InternalIDFields } from "../object_identification" +import { date } from "../fields/date" const IdentityVerificationEmailType = new GraphQLObjectType< any, @@ -19,13 +20,25 @@ const IdentityVerificationEmailType = new GraphQLObjectType< name: "IdentityVerificationEmail", fields: () => ({ ...InternalIDFields, + created_at: date(({ created_at }) => created_at), + email: { + description: "Email of the identity verification's owner", + type: GraphQLString, + resolve: ({ email }) => email, + }, + name: { + description: "Name of the identity verification's owner", + type: GraphQLString, + resolve: ({ name }) => name, + }, state: { type: new GraphQLNonNull(GraphQLString), description: "Identity verification lifecycle state", }, + updated_at: date(({ updated_at }) => updated_at), userID: { description: "User ID of the identity verification's owner", - type: new GraphQLNonNull(GraphQLString), + type: GraphQLString, resolve: ({ user_id }) => user_id, }, }), @@ -78,6 +91,11 @@ export const sendIdentityVerificationEmailMutation = mutationWithClientMutationI description: "Send a identity verification email", inputFields: { userID: { + description: "The user Id for the user undergoing identity verificaiton", + type: GraphQLString, + }, + email: { + description: "The email for the user undergoing identity verificaiton", type: GraphQLString, }, }, @@ -88,14 +106,14 @@ export const sendIdentityVerificationEmailMutation = mutationWithClientMutationI }, }, mutateAndGetPayload: ( - { userID }, + { userID, email }, { sendIdentityVerificationEmailLoader } ) => { if (!sendIdentityVerificationEmailLoader) { throw new Error("You need to be signed in to perform this action") } - return sendIdentityVerificationEmailLoader(userID) + return sendIdentityVerificationEmailLoader({ user_id: userID, email }) .then((result) => result) .catch((error) => { const formattedErr = formatGravityError(error)