/**
 * GQTY: You can safely modify this file and Query Fetcher based on your needs
 */ import { createReactClient } from '@gqty/react' ; import { createClient , QueryFetcher } from 'gqty' ; import { generatedSchema , scalarsEnumsHash , GeneratedSchema , SchemaObjectTypes , SchemaObjectTypesNames , } from './schema.generated' ; const queryFetcher = async function ( query , variables ) { const response = await fetch ( 'https://examples-api.gqty.dev/graphql' , { method : 'POST' , headers : { 'Content-Type' : 'application/json' , } , body : JSON . stringify ( { query , variables , } ) , mode : 'cors' , } ) ; const json = await response . json ( ) ; return json ; } ; export const client = createClient < GeneratedSchema , SchemaObjectTypesNames , SchemaObjectTypes > ( { schema : generatedSchema , scalarsEnumsHash , queryFetcher , } ) ; const { query , mutation , mutate , subscription , resolved , refetch } = client ; export { query , mutation , mutate , subscription , resolved , refetch } ; const { graphql , useQuery , usePaginatedQuery , useTransactionQuery , useLazyQuery , useRefetch , useMutation , useMetaState , prepareReactRender , useHydrateCache , prepareQuery , } = createReactClient < GeneratedSchema > ( client , { defaults : { suspense : false , staleWhileRevalidate : false , } , } ) ; export { graphql , useQuery , usePaginatedQuery , useTransactionQuery , useLazyQuery , useRefetch , useMutation , useMetaState , prepareReactRender , useHydrateCache , prepareQuery , } ; export * from './schema.generated' ;