You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
316 lines
12 KiB
316 lines
12 KiB
import { gql } from '@apollo/client';
|
|
import * as Apollo from '@apollo/client';
|
|
export type Maybe<T> = T | null;
|
|
export type InputMaybe<T> = Maybe<T>;
|
|
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
const defaultOptions = {} as const;
|
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
export type Scalars = {
|
|
ID: string;
|
|
String: string;
|
|
Boolean: boolean;
|
|
Int: number;
|
|
Float: number;
|
|
};
|
|
|
|
export type Mutation = {
|
|
__typename?: 'Mutation';
|
|
addTask: TaskType;
|
|
changeDone: TaskType;
|
|
deleteTask: Scalars['Boolean'];
|
|
signIn: Scalars['String'];
|
|
signUp: Scalars['Boolean'];
|
|
};
|
|
|
|
|
|
export type MutationAddTaskArgs = {
|
|
description: Scalars['String'];
|
|
title: Scalars['String'];
|
|
};
|
|
|
|
|
|
export type MutationChangeDoneArgs = {
|
|
taskId: Scalars['ID'];
|
|
};
|
|
|
|
|
|
export type MutationDeleteTaskArgs = {
|
|
taskId: Scalars['ID'];
|
|
};
|
|
|
|
|
|
export type MutationSignInArgs = {
|
|
password: Scalars['String'];
|
|
username: Scalars['String'];
|
|
};
|
|
|
|
|
|
export type MutationSignUpArgs = {
|
|
password: Scalars['String'];
|
|
username: Scalars['String'];
|
|
};
|
|
|
|
export type Query = {
|
|
__typename?: 'Query';
|
|
getTasks: Array<TaskType>;
|
|
};
|
|
|
|
export type TaskType = {
|
|
__typename?: 'TaskType';
|
|
description: Scalars['String'];
|
|
id: Scalars['ID'];
|
|
isDone: Scalars['Boolean'];
|
|
title: Scalars['String'];
|
|
};
|
|
|
|
export type TaskFragment = { __typename?: 'TaskType', description: string, isDone: boolean, title: string, id: string };
|
|
|
|
export type AddTaskMutationVariables = Exact<{
|
|
description: Scalars['String'];
|
|
title: Scalars['String'];
|
|
}>;
|
|
|
|
|
|
export type AddTaskMutation = { __typename?: 'Mutation', addTask: { __typename?: 'TaskType', description: string, isDone: boolean, title: string, id: string } };
|
|
|
|
export type ChangeDoneMutationVariables = Exact<{
|
|
id: Scalars['ID'];
|
|
}>;
|
|
|
|
|
|
export type ChangeDoneMutation = { __typename?: 'Mutation', changeDone: { __typename?: 'TaskType', description: string, isDone: boolean, title: string, id: string } };
|
|
|
|
export type DeleteTaskMutationVariables = Exact<{
|
|
id: Scalars['ID'];
|
|
}>;
|
|
|
|
|
|
export type DeleteTaskMutation = { __typename?: 'Mutation', deleteTask: boolean };
|
|
|
|
export type SignInMutationVariables = Exact<{
|
|
password: Scalars['String'];
|
|
username: Scalars['String'];
|
|
}>;
|
|
|
|
|
|
export type SignInMutation = { __typename?: 'Mutation', signIn: string };
|
|
|
|
export type SignUpMutationVariables = Exact<{
|
|
password: Scalars['String'];
|
|
username: Scalars['String'];
|
|
}>;
|
|
|
|
|
|
export type SignUpMutation = { __typename?: 'Mutation', signUp: boolean };
|
|
|
|
export type GetTasksQueryVariables = Exact<{ [key: string]: never; }>;
|
|
|
|
|
|
export type GetTasksQuery = { __typename?: 'Query', getTasks: Array<{ __typename?: 'TaskType', description: string, isDone: boolean, title: string, id: string }> };
|
|
|
|
export const TaskFragmentDoc = gql`
|
|
fragment task on TaskType {
|
|
description
|
|
isDone
|
|
title
|
|
id
|
|
}
|
|
`;
|
|
export const AddTaskDocument = gql`
|
|
mutation addTask($description: String!, $title: String!) {
|
|
addTask(description: $description, title: $title) {
|
|
...task
|
|
}
|
|
}
|
|
${TaskFragmentDoc}`;
|
|
export type AddTaskMutationFn = Apollo.MutationFunction<AddTaskMutation, AddTaskMutationVariables>;
|
|
|
|
/**
|
|
* __useAddTaskMutation__
|
|
*
|
|
* To run a mutation, you first call `useAddTaskMutation` within a React component and pass it any options that fit your needs.
|
|
* When your component renders, `useAddTaskMutation` 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 [addTaskMutation, { data, loading, error }] = useAddTaskMutation({
|
|
* variables: {
|
|
* description: // value for 'description'
|
|
* title: // value for 'title'
|
|
* },
|
|
* });
|
|
*/
|
|
export function useAddTaskMutation(baseOptions?: Apollo.MutationHookOptions<AddTaskMutation, AddTaskMutationVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useMutation<AddTaskMutation, AddTaskMutationVariables>(AddTaskDocument, options);
|
|
}
|
|
export type AddTaskMutationHookResult = ReturnType<typeof useAddTaskMutation>;
|
|
export type AddTaskMutationResult = Apollo.MutationResult<AddTaskMutation>;
|
|
export type AddTaskMutationOptions = Apollo.BaseMutationOptions<AddTaskMutation, AddTaskMutationVariables>;
|
|
export const ChangeDoneDocument = gql`
|
|
mutation changeDone($id: ID!) {
|
|
changeDone(taskId: $id) {
|
|
...task
|
|
}
|
|
}
|
|
${TaskFragmentDoc}`;
|
|
export type ChangeDoneMutationFn = Apollo.MutationFunction<ChangeDoneMutation, ChangeDoneMutationVariables>;
|
|
|
|
/**
|
|
* __useChangeDoneMutation__
|
|
*
|
|
* To run a mutation, you first call `useChangeDoneMutation` within a React component and pass it any options that fit your needs.
|
|
* When your component renders, `useChangeDoneMutation` 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 [changeDoneMutation, { data, loading, error }] = useChangeDoneMutation({
|
|
* variables: {
|
|
* id: // value for 'id'
|
|
* },
|
|
* });
|
|
*/
|
|
export function useChangeDoneMutation(baseOptions?: Apollo.MutationHookOptions<ChangeDoneMutation, ChangeDoneMutationVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useMutation<ChangeDoneMutation, ChangeDoneMutationVariables>(ChangeDoneDocument, options);
|
|
}
|
|
export type ChangeDoneMutationHookResult = ReturnType<typeof useChangeDoneMutation>;
|
|
export type ChangeDoneMutationResult = Apollo.MutationResult<ChangeDoneMutation>;
|
|
export type ChangeDoneMutationOptions = Apollo.BaseMutationOptions<ChangeDoneMutation, ChangeDoneMutationVariables>;
|
|
export const DeleteTaskDocument = gql`
|
|
mutation deleteTask($id: ID!) {
|
|
deleteTask(taskId: $id)
|
|
}
|
|
`;
|
|
export type DeleteTaskMutationFn = Apollo.MutationFunction<DeleteTaskMutation, DeleteTaskMutationVariables>;
|
|
|
|
/**
|
|
* __useDeleteTaskMutation__
|
|
*
|
|
* To run a mutation, you first call `useDeleteTaskMutation` within a React component and pass it any options that fit your needs.
|
|
* When your component renders, `useDeleteTaskMutation` 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 [deleteTaskMutation, { data, loading, error }] = useDeleteTaskMutation({
|
|
* variables: {
|
|
* id: // value for 'id'
|
|
* },
|
|
* });
|
|
*/
|
|
export function useDeleteTaskMutation(baseOptions?: Apollo.MutationHookOptions<DeleteTaskMutation, DeleteTaskMutationVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useMutation<DeleteTaskMutation, DeleteTaskMutationVariables>(DeleteTaskDocument, options);
|
|
}
|
|
export type DeleteTaskMutationHookResult = ReturnType<typeof useDeleteTaskMutation>;
|
|
export type DeleteTaskMutationResult = Apollo.MutationResult<DeleteTaskMutation>;
|
|
export type DeleteTaskMutationOptions = Apollo.BaseMutationOptions<DeleteTaskMutation, DeleteTaskMutationVariables>;
|
|
export const SignInDocument = gql`
|
|
mutation signIn($password: String!, $username: String!) {
|
|
signIn(password: $password, username: $username)
|
|
}
|
|
`;
|
|
export type SignInMutationFn = Apollo.MutationFunction<SignInMutation, SignInMutationVariables>;
|
|
|
|
/**
|
|
* __useSignInMutation__
|
|
*
|
|
* To run a mutation, you first call `useSignInMutation` within a React component and pass it any options that fit your needs.
|
|
* When your component renders, `useSignInMutation` 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 [signInMutation, { data, loading, error }] = useSignInMutation({
|
|
* variables: {
|
|
* password: // value for 'password'
|
|
* username: // value for 'username'
|
|
* },
|
|
* });
|
|
*/
|
|
export function useSignInMutation(baseOptions?: Apollo.MutationHookOptions<SignInMutation, SignInMutationVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useMutation<SignInMutation, SignInMutationVariables>(SignInDocument, options);
|
|
}
|
|
export type SignInMutationHookResult = ReturnType<typeof useSignInMutation>;
|
|
export type SignInMutationResult = Apollo.MutationResult<SignInMutation>;
|
|
export type SignInMutationOptions = Apollo.BaseMutationOptions<SignInMutation, SignInMutationVariables>;
|
|
export const SignUpDocument = gql`
|
|
mutation signUp($password: String!, $username: String!) {
|
|
signUp(password: $password, username: $username)
|
|
}
|
|
`;
|
|
export type SignUpMutationFn = Apollo.MutationFunction<SignUpMutation, SignUpMutationVariables>;
|
|
|
|
/**
|
|
* __useSignUpMutation__
|
|
*
|
|
* To run a mutation, you first call `useSignUpMutation` within a React component and pass it any options that fit your needs.
|
|
* When your component renders, `useSignUpMutation` 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 [signUpMutation, { data, loading, error }] = useSignUpMutation({
|
|
* variables: {
|
|
* password: // value for 'password'
|
|
* username: // value for 'username'
|
|
* },
|
|
* });
|
|
*/
|
|
export function useSignUpMutation(baseOptions?: Apollo.MutationHookOptions<SignUpMutation, SignUpMutationVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useMutation<SignUpMutation, SignUpMutationVariables>(SignUpDocument, options);
|
|
}
|
|
export type SignUpMutationHookResult = ReturnType<typeof useSignUpMutation>;
|
|
export type SignUpMutationResult = Apollo.MutationResult<SignUpMutation>;
|
|
export type SignUpMutationOptions = Apollo.BaseMutationOptions<SignUpMutation, SignUpMutationVariables>;
|
|
export const GetTasksDocument = gql`
|
|
query getTasks {
|
|
getTasks {
|
|
...task
|
|
}
|
|
}
|
|
${TaskFragmentDoc}`;
|
|
|
|
/**
|
|
* __useGetTasksQuery__
|
|
*
|
|
* To run a query within a React component, call `useGetTasksQuery` and pass it any options that fit your needs.
|
|
* When your component renders, `useGetTasksQuery` 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 } = useGetTasksQuery({
|
|
* variables: {
|
|
* },
|
|
* });
|
|
*/
|
|
export function useGetTasksQuery(baseOptions?: Apollo.QueryHookOptions<GetTasksQuery, GetTasksQueryVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useQuery<GetTasksQuery, GetTasksQueryVariables>(GetTasksDocument, options);
|
|
}
|
|
export function useGetTasksLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTasksQuery, GetTasksQueryVariables>) {
|
|
const options = {...defaultOptions, ...baseOptions}
|
|
return Apollo.useLazyQuery<GetTasksQuery, GetTasksQueryVariables>(GetTasksDocument, options);
|
|
}
|
|
export type GetTasksQueryHookResult = ReturnType<typeof useGetTasksQuery>;
|
|
export type GetTasksLazyQueryHookResult = ReturnType<typeof useGetTasksLazyQuery>;
|
|
export type GetTasksQueryResult = Apollo.QueryResult<GetTasksQuery, GetTasksQueryVariables>; |