import gql from "graphql-tag"; import * as ApolloReactCommon from "@apollo/react-common"; import * as ApolloReactHooks from "@apollo/react-hooks"; export type Maybe = T | null; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; String: string; Boolean: boolean; Int: number; Float: number; }; /** expression to compare columns of type Boolean. All fields are combined with logical 'AND'. */ export type BooleanComparisonExp = { _eq?: Maybe; _gt?: Maybe; _gte?: Maybe; _in?: Maybe>; _is_null?: Maybe; _lt?: Maybe; _lte?: Maybe; _neq?: Maybe; _nin?: Maybe>; }; /** expression to compare columns of type Int. All fields are combined with logical 'AND'. */ export type IntComparisonExp = { _eq?: Maybe; _gt?: Maybe; _gte?: Maybe; _in?: Maybe>; _is_null?: Maybe; _lt?: Maybe; _lte?: Maybe; _neq?: Maybe; _nin?: Maybe>; }; /** mutation root */ export type MutationRoot = { __typename?: "mutation_root"; /** delete data from the table: "todos" */ delete_todos?: Maybe; /** delete single row from the table: "todos" */ delete_todos_by_pk?: Maybe; /** insert data into the table: "todos" */ insert_todos?: Maybe; /** insert a single row into the table: "todos" */ insert_todos_one?: Maybe; /** update data of the table: "todos" */ update_todos?: Maybe; /** update single row of the table: "todos" */ update_todos_by_pk?: Maybe; }; /** mutation root */ export type MutationRootDeleteTodosArgs = { where: TodosBoolExp; }; /** mutation root */ export type MutationRootDeleteTodosByPkArgs = { id: Scalars["Int"]; }; /** mutation root */ export type MutationRootInsertTodosArgs = { objects: Array; on_conflict?: Maybe; }; /** mutation root */ export type MutationRootInsertTodosOneArgs = { object: TodosInsertInput; on_conflict?: Maybe; }; /** mutation root */ export type MutationRootUpdateTodosArgs = { _inc?: Maybe; _set?: Maybe; where: TodosBoolExp; }; /** mutation root */ export type MutationRootUpdateTodosByPkArgs = { _inc?: Maybe; _set?: Maybe; pk_columns: TodosPkColumnsInput; }; /** column ordering options */ export enum OrderBy { /** in the ascending order, nulls last */ Asc = "asc", /** in the ascending order, nulls first */ AscNullsFirst = "asc_nulls_first", /** in the ascending order, nulls last */ AscNullsLast = "asc_nulls_last", /** in the descending order, nulls first */ Desc = "desc", /** in the descending order, nulls first */ DescNullsFirst = "desc_nulls_first", /** in the descending order, nulls last */ DescNullsLast = "desc_nulls_last", } /** query root */ export type QueryRoot = { __typename?: "query_root"; /** fetch data from the table: "todos" */ todos: Array; /** fetch aggregated fields from the table: "todos" */ todos_aggregate: TodosAggregate; /** fetch data from the table: "todos" using primary key columns */ todos_by_pk?: Maybe; }; /** query root */ export type QueryRootTodosArgs = { distinct_on?: Maybe>; limit?: Maybe; offset?: Maybe; order_by?: Maybe>; where?: Maybe; }; /** query root */ export type QueryRootTodosAggregateArgs = { distinct_on?: Maybe>; limit?: Maybe; offset?: Maybe; order_by?: Maybe>; where?: Maybe; }; /** query root */ export type QueryRootTodosByPkArgs = { id: Scalars["Int"]; }; /** expression to compare columns of type String. All fields are combined with logical 'AND'. */ export type StringComparisonExp = { _eq?: Maybe; _gt?: Maybe; _gte?: Maybe; _ilike?: Maybe; _in?: Maybe>; _is_null?: Maybe; _like?: Maybe; _lt?: Maybe; _lte?: Maybe; _neq?: Maybe; _nilike?: Maybe; _nin?: Maybe>; _nlike?: Maybe; _nsimilar?: Maybe; _similar?: Maybe; }; /** subscription root */ export type SubscriptionRoot = { __typename?: "subscription_root"; /** fetch data from the table: "todos" */ todos: Array; /** fetch aggregated fields from the table: "todos" */ todos_aggregate: TodosAggregate; /** fetch data from the table: "todos" using primary key columns */ todos_by_pk?: Maybe; }; /** subscription root */ export type SubscriptionRootTodosArgs = { distinct_on?: Maybe>; limit?: Maybe; offset?: Maybe; order_by?: Maybe>; where?: Maybe; }; /** subscription root */ export type SubscriptionRootTodosAggregateArgs = { distinct_on?: Maybe>; limit?: Maybe; offset?: Maybe; order_by?: Maybe>; where?: Maybe; }; /** subscription root */ export type SubscriptionRootTodosByPkArgs = { id: Scalars["Int"]; }; /** columns and relationships of "todos" */ export type Todos = { __typename?: "todos"; complete: Scalars["Boolean"]; id: Scalars["Int"]; name: Scalars["String"]; uid?: Maybe; }; /** aggregated selection of "todos" */ export type TodosAggregate = { __typename?: "todos_aggregate"; aggregate?: Maybe; nodes: Array; }; /** aggregate fields of "todos" */ export type TodosAggregateFields = { __typename?: "todos_aggregate_fields"; avg?: Maybe; count?: Maybe; max?: Maybe; min?: Maybe; stddev?: Maybe; stddev_pop?: Maybe; stddev_samp?: Maybe; sum?: Maybe; var_pop?: Maybe; var_samp?: Maybe; variance?: Maybe; }; /** aggregate fields of "todos" */ export type TodosAggregateFieldsCountArgs = { columns?: Maybe>; distinct?: Maybe; }; /** order by aggregate values of table "todos" */ export type TodosAggregateOrderBy = { avg?: Maybe; count?: Maybe; max?: Maybe; min?: Maybe; stddev?: Maybe; stddev_pop?: Maybe; stddev_samp?: Maybe; sum?: Maybe; var_pop?: Maybe; var_samp?: Maybe; variance?: Maybe; }; /** input type for inserting array relation for remote table "todos" */ export type TodosArrRelInsertInput = { data: Array; on_conflict?: Maybe; }; /** aggregate avg on columns */ export type TodosAvgFields = { __typename?: "todos_avg_fields"; id?: Maybe; }; /** order by avg() on columns of table "todos" */ export type TodosAvgOrderBy = { id?: Maybe; }; /** Boolean expression to filter rows from the table "todos". All fields are combined with a logical 'AND'. */ export type TodosBoolExp = { _and?: Maybe>>; _not?: Maybe; _or?: Maybe>>; complete?: Maybe; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** unique or primary key constraints on table "todos" */ export enum TodosConstraint { /** unique or primary key constraint */ TodosPkey = "todos_pkey", } /** input type for incrementing integer column in table "todos" */ export type TodosIncInput = { id?: Maybe; }; /** input type for inserting data into table "todos" */ export type TodosInsertInput = { complete?: Maybe; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** aggregate max on columns */ export type TodosMaxFields = { __typename?: "todos_max_fields"; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** order by max() on columns of table "todos" */ export type TodosMaxOrderBy = { id?: Maybe; name?: Maybe; uid?: Maybe; }; /** aggregate min on columns */ export type TodosMinFields = { __typename?: "todos_min_fields"; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** order by min() on columns of table "todos" */ export type TodosMinOrderBy = { id?: Maybe; name?: Maybe; uid?: Maybe; }; /** response of any mutation on the table "todos" */ export type TodosMutationResponse = { __typename?: "todos_mutation_response"; /** number of affected rows by the mutation */ affected_rows: Scalars["Int"]; /** data of the affected rows by the mutation */ returning: Array; }; /** input type for inserting object relation for remote table "todos" */ export type TodosObjRelInsertInput = { data: TodosInsertInput; on_conflict?: Maybe; }; /** on conflict condition type for table "todos" */ export type TodosOnConflict = { constraint: TodosConstraint; update_columns: Array; where?: Maybe; }; /** ordering options when selecting data from "todos" */ export type TodosOrderBy = { complete?: Maybe; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** primary key columns input for table: "todos" */ export type TodosPkColumnsInput = { id: Scalars["Int"]; }; /** select columns of table "todos" */ export enum TodosSelectColumn { /** column name */ Complete = "complete", /** column name */ Id = "id", /** column name */ Name = "name", /** column name */ Uid = "uid", } /** input type for updating data in table "todos" */ export type TodosSetInput = { complete?: Maybe; id?: Maybe; name?: Maybe; uid?: Maybe; }; /** aggregate stddev on columns */ export type TodosStddevFields = { __typename?: "todos_stddev_fields"; id?: Maybe; }; /** order by stddev() on columns of table "todos" */ export type TodosStddevOrderBy = { id?: Maybe; }; /** aggregate stddev_pop on columns */ export type TodosStddevPopFields = { __typename?: "todos_stddev_pop_fields"; id?: Maybe; }; /** order by stddev_pop() on columns of table "todos" */ export type TodosStddevPopOrderBy = { id?: Maybe; }; /** aggregate stddev_samp on columns */ export type TodosStddevSampFields = { __typename?: "todos_stddev_samp_fields"; id?: Maybe; }; /** order by stddev_samp() on columns of table "todos" */ export type TodosStddevSampOrderBy = { id?: Maybe; }; /** aggregate sum on columns */ export type TodosSumFields = { __typename?: "todos_sum_fields"; id?: Maybe; }; /** order by sum() on columns of table "todos" */ export type TodosSumOrderBy = { id?: Maybe; }; /** update columns of table "todos" */ export enum TodosUpdateColumn { /** column name */ Complete = "complete", /** column name */ Id = "id", /** column name */ Name = "name", /** column name */ Uid = "uid", } /** aggregate var_pop on columns */ export type TodosVarPopFields = { __typename?: "todos_var_pop_fields"; id?: Maybe; }; /** order by var_pop() on columns of table "todos" */ export type TodosVarPopOrderBy = { id?: Maybe; }; /** aggregate var_samp on columns */ export type TodosVarSampFields = { __typename?: "todos_var_samp_fields"; id?: Maybe; }; /** order by var_samp() on columns of table "todos" */ export type TodosVarSampOrderBy = { id?: Maybe; }; /** aggregate variance on columns */ export type TodosVarianceFields = { __typename?: "todos_variance_fields"; id?: Maybe; }; /** order by variance() on columns of table "todos" */ export type TodosVarianceOrderBy = { id?: Maybe; }; export type TodosQueryVariables = {}; export type TodosQuery = { __typename?: "query_root" } & { todos: Array< { __typename?: "todos" } & Pick >; }; export type CreateTodoMutationVariables = { name: Scalars["String"]; }; export type CreateTodoMutation = { __typename?: "mutation_root" } & { insert_todos?: Maybe< { __typename?: "todos_mutation_response" } & { returning: Array< { __typename?: "todos" } & Pick >; } >; }; export type UpdateTodoMutationVariables = { id: Scalars["Int"]; complete: Scalars["Boolean"]; }; export type UpdateTodoMutation = { __typename?: "mutation_root" } & { update_todos?: Maybe< { __typename?: "todos_mutation_response" } & { returning: Array< { __typename?: "todos" } & Pick >; } >; }; export type DestroyTodoMutationVariables = { id: Scalars["Int"]; }; export type DestroyTodoMutation = { __typename?: "mutation_root" } & { delete_todos?: Maybe< { __typename?: "todos_mutation_response" } & { returning: Array<{ __typename?: "todos" } & Pick>; } >; }; export const TodosDocument = gql` query Todos { todos { id name complete } } `; /** * __useTodosQuery__ * * To run a query within a React component, call `useTodosQuery` and pass it any options that fit your needs. * When your component renders, `useTodosQuery` 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 } = useTodosQuery({ * variables: { * }, * }); */ export function useTodosQuery( baseOptions?: ApolloReactHooks.QueryHookOptions< TodosQuery, TodosQueryVariables > ) { return ApolloReactHooks.useQuery( TodosDocument, baseOptions ); } export function useTodosLazyQuery( baseOptions?: ApolloReactHooks.LazyQueryHookOptions< TodosQuery, TodosQueryVariables > ) { return ApolloReactHooks.useLazyQuery( TodosDocument, baseOptions ); } export type TodosQueryHookResult = ReturnType; export type TodosLazyQueryHookResult = ReturnType; export type TodosQueryResult = ApolloReactCommon.QueryResult< TodosQuery, TodosQueryVariables >; export const CreateTodoDocument = gql` mutation CreateTodo($name: String!) { insert_todos(objects: { name: $name }) { returning { name id complete } } } `; export type CreateTodoMutationFn = ApolloReactCommon.MutationFunction< CreateTodoMutation, CreateTodoMutationVariables >; /** * __useCreateTodoMutation__ * * To run a mutation, you first call `useCreateTodoMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateTodoMutation` 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 [createTodoMutation, { data, loading, error }] = useCreateTodoMutation({ * variables: { * name: // value for 'name' * }, * }); */ export function useCreateTodoMutation( baseOptions?: ApolloReactHooks.MutationHookOptions< CreateTodoMutation, CreateTodoMutationVariables > ) { return ApolloReactHooks.useMutation< CreateTodoMutation, CreateTodoMutationVariables >(CreateTodoDocument, baseOptions); } export type CreateTodoMutationHookResult = ReturnType< typeof useCreateTodoMutation >; export type CreateTodoMutationResult = ApolloReactCommon.MutationResult< CreateTodoMutation >; export type CreateTodoMutationOptions = ApolloReactCommon.BaseMutationOptions< CreateTodoMutation, CreateTodoMutationVariables >; export const UpdateTodoDocument = gql` mutation UpdateTodo($id: Int!, $complete: Boolean!) { update_todos(where: { id: { _eq: $id } }, _set: { complete: $complete }) { returning { complete id name } } } `; export type UpdateTodoMutationFn = ApolloReactCommon.MutationFunction< UpdateTodoMutation, UpdateTodoMutationVariables >; /** * __useUpdateTodoMutation__ * * To run a mutation, you first call `useUpdateTodoMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateTodoMutation` 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 [updateTodoMutation, { data, loading, error }] = useUpdateTodoMutation({ * variables: { * id: // value for 'id' * complete: // value for 'complete' * }, * }); */ export function useUpdateTodoMutation( baseOptions?: ApolloReactHooks.MutationHookOptions< UpdateTodoMutation, UpdateTodoMutationVariables > ) { return ApolloReactHooks.useMutation< UpdateTodoMutation, UpdateTodoMutationVariables >(UpdateTodoDocument, baseOptions); } export type UpdateTodoMutationHookResult = ReturnType< typeof useUpdateTodoMutation >; export type UpdateTodoMutationResult = ApolloReactCommon.MutationResult< UpdateTodoMutation >; export type UpdateTodoMutationOptions = ApolloReactCommon.BaseMutationOptions< UpdateTodoMutation, UpdateTodoMutationVariables >; export const DestroyTodoDocument = gql` mutation DestroyTodo($id: Int!) { delete_todos(where: { id: { _eq: $id } }) { returning { id } } } `; export type DestroyTodoMutationFn = ApolloReactCommon.MutationFunction< DestroyTodoMutation, DestroyTodoMutationVariables >; /** * __useDestroyTodoMutation__ * * To run a mutation, you first call `useDestroyTodoMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDestroyTodoMutation` 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 [destroyTodoMutation, { data, loading, error }] = useDestroyTodoMutation({ * variables: { * id: // value for 'id' * }, * }); */ export function useDestroyTodoMutation( baseOptions?: ApolloReactHooks.MutationHookOptions< DestroyTodoMutation, DestroyTodoMutationVariables > ) { return ApolloReactHooks.useMutation< DestroyTodoMutation, DestroyTodoMutationVariables >(DestroyTodoDocument, baseOptions); } export type DestroyTodoMutationHookResult = ReturnType< typeof useDestroyTodoMutation >; export type DestroyTodoMutationResult = ApolloReactCommon.MutationResult< DestroyTodoMutation >; export type DestroyTodoMutationOptions = ApolloReactCommon.BaseMutationOptions< DestroyTodoMutation, DestroyTodoMutationVariables >;