Skip to content

Prototype of Fuel Hooks library using React Query and GraphQL Codegen

Notifications You must be signed in to change notification settings

dabit3/fuel-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

37be9b2 · Dec 17, 2022

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuel React Hooks for queries and mutations

Example implementation for React Hooks abstracting away the need to know graphql

Usage

// in root
import type { AppProps } from 'next/app'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
const queryClient = new QueryClient()

export default function App({ Component, pageProps }: AppProps) {
  return (
    <QueryClientProvider client={queryClient}>
      <Component {...pageProps} />
    </QueryClientProvider>
  )
}

// in component
import {
  useTransactionsQuery
} from './generated'

const {
  data, isLoading, error
} = useTransactionsQuery({
  first: 100
})

About

Prototype of Fuel Hooks library using React Query and GraphQL Codegen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published