diff --git a/src/index.tsx b/src/index.tsx index d76c583..5ef5663 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -184,6 +184,8 @@ export type Mutation = { createBucketSet: BucketSetGql; createUploadStream: CreateUploadStreamReturn; deleteVideo: Scalars["Boolean"]["output"]; + editProfileImageUri: UserGql; + getProfileImageUploadLink: GetUploadLinkReturn; getUploadLink: GetUploadLinkReturn; terminateUploadStream: Scalars["Boolean"]["output"]; }; @@ -200,6 +202,14 @@ export type MutationDeleteVideoArgs = { videoId: Scalars["Int"]["input"]; }; +export type MutationEditProfileImageUriArgs = { + profileImageUri: Scalars["String"]["input"]; +}; + +export type MutationGetProfileImageUploadLinkArgs = { + fileExt?: InputMaybe; +}; + export type MutationGetUploadLinkArgs = { segmentIndex: Scalars["Int"]["input"]; videoId: Scalars["Int"]["input"]; @@ -375,6 +385,7 @@ export type UserGql = { createdAt?: Maybe; firebaseUid: Scalars["String"]["output"]; id: Scalars["Int"]["output"]; + profileImageUri?: Maybe; statistics: UserStatisticsGql; updatedAt?: Maybe; username: Scalars["String"]["output"]; @@ -560,6 +571,40 @@ export type GetShotsQuery = { }>; }; +export type GetProfileImageUploadLinkMutationVariables = Exact<{ + fileExt?: InputMaybe; +}>; + +export type GetProfileImageUploadLinkMutation = { + __typename?: "Mutation"; + getProfileImageUploadLink: { + __typename?: "GetUploadLinkReturn"; + uploadUrl: string; + headers: Array<{ + __typename?: "Header"; + key: string; + value: string; + } | null>; + }; +}; + +export type EditProfileImageUriMutationVariables = Exact<{ + profileImageUri: Scalars["String"]["input"]; +}>; + +export type EditProfileImageUriMutation = { + __typename?: "Mutation"; + editProfileImageUri: { + __typename?: "UserGQL"; + id: number; + firebaseUid: string; + username: string; + profileImageUri?: string | null; + createdAt?: any | null; + updatedAt?: any | null; + }; +}; + export type GetStreamMonitoringDetailsQueryVariables = Exact<{ videoId: Scalars["Int"]["input"]; }>; @@ -1020,6 +1065,116 @@ export type GetShotsQueryResult = Apollo.QueryResult< GetShotsQuery, GetShotsQueryVariables >; +export const GetProfileImageUploadLinkDocument = gql` + mutation getProfileImageUploadLink($fileExt: String = ".png") { + getProfileImageUploadLink(fileExt: $fileExt) { + uploadUrl + headers { + key + value + } + } + } +`; +export type GetProfileImageUploadLinkMutationFn = Apollo.MutationFunction< + GetProfileImageUploadLinkMutation, + GetProfileImageUploadLinkMutationVariables +>; + +/** + * __useGetProfileImageUploadLinkMutation__ + * + * To run a mutation, you first call `useGetProfileImageUploadLinkMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useGetProfileImageUploadLinkMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [getProfileImageUploadLinkMutation, { data, loading, error }] = useGetProfileImageUploadLinkMutation({ + * variables: { + * fileExt: // value for 'fileExt' + * }, + * }); + */ +export function useGetProfileImageUploadLinkMutation( + baseOptions?: Apollo.MutationHookOptions< + GetProfileImageUploadLinkMutation, + GetProfileImageUploadLinkMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + GetProfileImageUploadLinkMutation, + GetProfileImageUploadLinkMutationVariables + >(GetProfileImageUploadLinkDocument, options); +} +export type GetProfileImageUploadLinkMutationHookResult = ReturnType< + typeof useGetProfileImageUploadLinkMutation +>; +export type GetProfileImageUploadLinkMutationResult = + Apollo.MutationResult; +export type GetProfileImageUploadLinkMutationOptions = + Apollo.BaseMutationOptions< + GetProfileImageUploadLinkMutation, + GetProfileImageUploadLinkMutationVariables + >; +export const EditProfileImageUriDocument = gql` + mutation editProfileImageUri($profileImageUri: String!) { + editProfileImageUri(profileImageUri: $profileImageUri) { + id + firebaseUid + username + profileImageUri + createdAt + updatedAt + } + } +`; +export type EditProfileImageUriMutationFn = Apollo.MutationFunction< + EditProfileImageUriMutation, + EditProfileImageUriMutationVariables +>; + +/** + * __useEditProfileImageUriMutation__ + * + * To run a mutation, you first call `useEditProfileImageUriMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useEditProfileImageUriMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [editProfileImageUriMutation, { data, loading, error }] = useEditProfileImageUriMutation({ + * variables: { + * profileImageUri: // value for 'profileImageUri' + * }, + * }); + */ +export function useEditProfileImageUriMutation( + baseOptions?: Apollo.MutationHookOptions< + EditProfileImageUriMutation, + EditProfileImageUriMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + EditProfileImageUriMutation, + EditProfileImageUriMutationVariables + >(EditProfileImageUriDocument, options); +} +export type EditProfileImageUriMutationHookResult = ReturnType< + typeof useEditProfileImageUriMutation +>; +export type EditProfileImageUriMutationResult = + Apollo.MutationResult; +export type EditProfileImageUriMutationOptions = Apollo.BaseMutationOptions< + EditProfileImageUriMutation, + EditProfileImageUriMutationVariables +>; export const GetStreamMonitoringDetailsDocument = gql` query GetStreamMonitoringDetails($videoId: Int!) { getVideo(videoId: $videoId) { diff --git a/src/operations/user.gql b/src/operations/user.gql new file mode 100644 index 0000000..1fb2b08 --- /dev/null +++ b/src/operations/user.gql @@ -0,0 +1,20 @@ +mutation getProfileImageUploadLink($fileExt: String = ".png") { + getProfileImageUploadLink(fileExt: $fileExt) { + uploadUrl + headers { + key + value + } + } +} + +mutation editProfileImageUri($profileImageUri: String!) { + editProfileImageUri(profileImageUri: $profileImageUri) { + id + firebaseUid + username + profileImageUri + createdAt + updatedAt + } +} diff --git a/src/schema.gql b/src/schema.gql index 300c196..8a061f8 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -106,6 +106,7 @@ type UserGQL { id: Int! firebaseUid: String! username: String! + profileImageUri: String createdAt: DateTime updatedAt: DateTime statistics: UserStatisticsGQL! @@ -284,6 +285,8 @@ type Mutation { videoMetadata: VideoMetadataInput! ): Boolean! deleteVideo(videoId: Int!): Boolean! + getProfileImageUploadLink(fileExt: String = ".png"): GetUploadLinkReturn! + editProfileImageUri(profileImageUri: String!): UserGQL! } input CreateBucketSetInput {