import { gql } from "@apollo/client"; import * as Apollo from "@apollo/client"; export type Maybe = T | null; export type Exact = { [K in keyof T]: T[K] }; export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; const defaultOptions = {}; /** 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 Product = { __typename?: "Product"; id: Scalars["ID"]; name: Scalars["String"]; salePriceExt: Scalars["Float"]; salePriceInt: Scalars["Float"]; }; export type ProductFilter = { active?: Maybe; id?: Maybe; }; export type Query = { __typename?: "Query"; allProducts: Array; }; export type QueryAllProductsArgs = { filters?: Maybe; }; export type AllProductsQueryVariables = Exact<{ active: Scalars["Boolean"]; }>; export type AllProductsQuery = { __typename?: "Query"; allProducts: Array<{ __typename?: "Product"; id: string; name: string; salePriceExt: number; salePriceInt: number }>; }; export const AllProductsDocument = gql` query allProducts($active: Boolean!) { allProducts(filters: { active: $active }) { id name salePriceExt salePriceInt } } `; /** * __useAllProductsQuery__ * * To run a query within a React component, call `useAllProductsQuery` and pass it any options that fit your needs. * When your component renders, `useAllProductsQuery` 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 } = useAllProductsQuery({ * variables: { * active: // value for 'active' * }, * }); */ export function useAllProductsQuery(baseOptions: Apollo.QueryHookOptions) { const options = { ...defaultOptions, ...baseOptions }; return Apollo.useQuery(AllProductsDocument, options); } export function useAllProductsLazyQuery( baseOptions?: Apollo.LazyQueryHookOptions ) { const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(AllProductsDocument, options); } export type AllProductsQueryHookResult = ReturnType; export type AllProductsLazyQueryHookResult = ReturnType; export type AllProductsQueryResult = Apollo.QueryResult;