Skip to content

fatpig0416/storefront-api-rn

Repository files navigation

Storefront api wrapper for ReactNative

$ yarn add @fatpig0416/storefront-api-rn

Configure wrapper

  import { createApiClient } from '@fatpig0416/storefront-api-rn'

  useEffect(() => {
    createApiClient({ api: 'YOUR-GRAPHQL-ENDPOINT })
  }, [])

Use APIs

  import { useProducts } from '@fatpig0416/storefront-api-rn'

  const { loading, data } = useProducts()
  import { useProduct } from '@fatpig0416/storefront-api-rn'

  const { loading, data } = useProduct(22)
  import { useCategories } from '@fatpig0416/storefront-api-rn'

  const { loading, data } = useCategories()
  import { useCategory } from '@fatpig0416/storefront-api-rn'

  const { loading, data } = useCategory(22)

About

Storefront API wrapper for ReactNative

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published