Add explicit auth client operations
This commit is contained in:
174
src/index.tsx
174
src/index.tsx
@@ -4709,6 +4709,31 @@ export type GetAggregatedShotMetricsQuery = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export type GetAuthBootstrapQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type GetAuthBootstrapQuery = {
|
||||
__typename?: "Query";
|
||||
getAuthBootstrap: {
|
||||
__typename?: "AuthBootstrapGQL";
|
||||
status: AuthBootstrapStatusEnum;
|
||||
user?: { __typename?: "UserGQL"; id: number; username: string } | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type CompleteAuthRegistrationMutationVariables = Exact<{
|
||||
username: Scalars["String"]["input"];
|
||||
agreesToMarketing: Scalars["Boolean"]["input"];
|
||||
}>;
|
||||
|
||||
export type CompleteAuthRegistrationMutation = {
|
||||
__typename?: "Mutation";
|
||||
completeAuthRegistration: {
|
||||
__typename?: "CompleteAuthRegistrationGQL";
|
||||
errorCode?: AuthRegistrationErrorEnum | null;
|
||||
user?: { __typename?: "UserGQL"; id: number; username: string } | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetChallengesQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type GetChallengesQuery = {
|
||||
@@ -5136,6 +5161,12 @@ export type GetDeployedConfigQuery = {
|
||||
message: string;
|
||||
priority: number;
|
||||
}>;
|
||||
socialAuthProviderAvailability: Array<{
|
||||
__typename?: "SocialAuthProviderAvailabilityGQL";
|
||||
provider: SocialAuthProviderEnum;
|
||||
platform: SocialAuthPlatformEnum;
|
||||
enabled: boolean;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10720,6 +10751,144 @@ export type GetAggregatedShotMetricsQueryResult = Apollo.QueryResult<
|
||||
GetAggregatedShotMetricsQuery,
|
||||
GetAggregatedShotMetricsQueryVariables
|
||||
>;
|
||||
export const GetAuthBootstrapDocument = gql`
|
||||
query getAuthBootstrap {
|
||||
getAuthBootstrap {
|
||||
status
|
||||
user {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useGetAuthBootstrapQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useGetAuthBootstrapQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetAuthBootstrapQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useGetAuthBootstrapQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useGetAuthBootstrapQuery(
|
||||
baseOptions?: Apollo.QueryHookOptions<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<GetAuthBootstrapQuery, GetAuthBootstrapQueryVariables>(
|
||||
GetAuthBootstrapDocument,
|
||||
options,
|
||||
);
|
||||
}
|
||||
export function useGetAuthBootstrapLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>(GetAuthBootstrapDocument, options);
|
||||
}
|
||||
export function useGetAuthBootstrapSuspenseQuery(
|
||||
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useSuspenseQuery<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>(GetAuthBootstrapDocument, options);
|
||||
}
|
||||
export type GetAuthBootstrapQueryHookResult = ReturnType<
|
||||
typeof useGetAuthBootstrapQuery
|
||||
>;
|
||||
export type GetAuthBootstrapLazyQueryHookResult = ReturnType<
|
||||
typeof useGetAuthBootstrapLazyQuery
|
||||
>;
|
||||
export type GetAuthBootstrapSuspenseQueryHookResult = ReturnType<
|
||||
typeof useGetAuthBootstrapSuspenseQuery
|
||||
>;
|
||||
export type GetAuthBootstrapQueryResult = Apollo.QueryResult<
|
||||
GetAuthBootstrapQuery,
|
||||
GetAuthBootstrapQueryVariables
|
||||
>;
|
||||
export const CompleteAuthRegistrationDocument = gql`
|
||||
mutation completeAuthRegistration(
|
||||
$username: String!
|
||||
$agreesToMarketing: Boolean!
|
||||
) {
|
||||
completeAuthRegistration(
|
||||
username: $username
|
||||
agreesToMarketing: $agreesToMarketing
|
||||
) {
|
||||
errorCode
|
||||
user {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export type CompleteAuthRegistrationMutationFn = Apollo.MutationFunction<
|
||||
CompleteAuthRegistrationMutation,
|
||||
CompleteAuthRegistrationMutationVariables
|
||||
>;
|
||||
|
||||
/**
|
||||
* __useCompleteAuthRegistrationMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useCompleteAuthRegistrationMutation` within a React component and pass it any options that fit your needs.
|
||||
* When your component renders, `useCompleteAuthRegistrationMutation` 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 [completeAuthRegistrationMutation, { data, loading, error }] = useCompleteAuthRegistrationMutation({
|
||||
* variables: {
|
||||
* username: // value for 'username'
|
||||
* agreesToMarketing: // value for 'agreesToMarketing'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useCompleteAuthRegistrationMutation(
|
||||
baseOptions?: Apollo.MutationHookOptions<
|
||||
CompleteAuthRegistrationMutation,
|
||||
CompleteAuthRegistrationMutationVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useMutation<
|
||||
CompleteAuthRegistrationMutation,
|
||||
CompleteAuthRegistrationMutationVariables
|
||||
>(CompleteAuthRegistrationDocument, options);
|
||||
}
|
||||
export type CompleteAuthRegistrationMutationHookResult = ReturnType<
|
||||
typeof useCompleteAuthRegistrationMutation
|
||||
>;
|
||||
export type CompleteAuthRegistrationMutationResult =
|
||||
Apollo.MutationResult<CompleteAuthRegistrationMutation>;
|
||||
export type CompleteAuthRegistrationMutationOptions =
|
||||
Apollo.BaseMutationOptions<
|
||||
CompleteAuthRegistrationMutation,
|
||||
CompleteAuthRegistrationMutationVariables
|
||||
>;
|
||||
export const GetChallengesDocument = gql`
|
||||
query GetChallenges {
|
||||
challenges {
|
||||
@@ -12127,6 +12296,11 @@ export const GetDeployedConfigDocument = gql`
|
||||
}
|
||||
defaultAndroidRecordingFormat
|
||||
bucketUrl
|
||||
socialAuthProviderAvailability {
|
||||
provider
|
||||
platform
|
||||
enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
25
src/operations/auth.gql
Normal file
25
src/operations/auth.gql
Normal file
@@ -0,0 +1,25 @@
|
||||
query getAuthBootstrap {
|
||||
getAuthBootstrap {
|
||||
status
|
||||
user {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mutation completeAuthRegistration(
|
||||
$username: String!
|
||||
$agreesToMarketing: Boolean!
|
||||
) {
|
||||
completeAuthRegistration(
|
||||
username: $username
|
||||
agreesToMarketing: $agreesToMarketing
|
||||
) {
|
||||
errorCode
|
||||
user {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,5 +19,10 @@ query getDeployedConfig {
|
||||
}
|
||||
defaultAndroidRecordingFormat
|
||||
bucketUrl
|
||||
socialAuthProviderAvailability {
|
||||
provider
|
||||
platform
|
||||
enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user