npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brand-map/react-query-client

v0.0.10-alpha.34

Published

Brand-Map React Query client helpers.

Readme

React Query Client

React Query helpers for the Brand-Map TypeScript SDK.

Create one Brand-Map SDK client, pass it to one React Query client, then call operations by route operationId:

import { createBrandMapClient } from "@brand-map/ts-client"
import { createReactQueryClient } from "@brand-map/react-query-client"

export const fetchClient = createBrandMapClient({
  baseUrl: "https://brand-map.site/api",
})
export const client = createReactQueryClient(fetchClient)

const productsQuery = client.useQuery("list-products", {
  query: {
    filters: {
      status: { $eq: "published" },
    },
  },
})

Successful Brand-Map responses are unwrapped by default, so data is the SDK payload and errors are surfaced as BrandMapQueryError.

Install

npm install @brand-map/react-query-client @brand-map/ts-client @tanstack/react-query react

Query Options

Use queryOptions for TanStack APIs such as fetchQuery, prefetchQuery, and invalidateQueries:

import { QueryClient } from "@tanstack/react-query"
import { createBrandMapClient } from "@brand-map/ts-client"
import { createReactQueryClient } from "@brand-map/react-query-client"

const tanstackQueryClient = new QueryClient()
const fetchClient = createBrandMapClient({
  baseUrl: "https://brand-map.site/api",
})
const client = createReactQueryClient(fetchClient)

await tanstackQueryClient.fetchQuery(
  client.queryOptions("list-products", {
    query: { pagination: { take: 20, skip: 0 } },
  }),
)

tanstackQueryClient.invalidateQueries(
  client.queryOptions("list-products", {
    query: { filters: { status: { $eq: "published" } } },
  }),
)

Filters stay under query.filters, matching the generated TypeScript SDK query types.

React Setup

Use TanStack Query's provider at the app boundary. The Brand-Map React Query client is just an imported instance:

import { QueryClientProvider } from "@tanstack/react-query"
import { client } from "./brand-map-client"
import { tanstackQueryClient } from "./query-client"

function Products() {
  const products = client.useQuery("list-products")

  return products.data?.[0]?.title
}

<QueryClientProvider client={tanstackQueryClient}>
  <Products />
</QueryClientProvider>

Mutations

Mutation operations are variable-driven. Pass TanStack mutation options when creating the hook, then pass operation variables to mutate:

const createProduct = client.useMutation("create-product", {
  options: {
    onSuccess: () => {
      tanstackQueryClient.invalidateQueries(client.queryOptions("admin-list-products"))
    },
  },
})

createProduct.mutate({
  body: {
    title: "New product",
    slug: "new-product",
    status: "draft",
  },
})

Public Surface

The root export contains createReactQueryClient, createBrandMapReactQueryClient, BrandMapQueryError, operation-key types, and shared option types.

Alpha.9 Compatibility

The alpha.9 resource-helper API is available only through compatibility subpaths. The root export stays operation-key based.

import { BrandMapProvider, configureBrandMapQueryClient } from "@brand-map/react-query-client/react"
import { listProducts } from "@brand-map/react-query-client/store/product"
import { createBrandMapClient } from "@brand-map/ts-client"
import { useQuery } from "@tanstack/react-query"

const fetchClient = createBrandMapClient({
  baseUrl: "https://brand-map.site/api",
})

configureBrandMapQueryClient(fetchClient)

const productsQuery = useQuery(
  listProducts({
    query: {
      filters: {
        status: { $eq: "published" },
      },
    },
  }),
)

Legacy helpers also accept client?: BrandMapClient directly. If no client is supplied, they use the separately configured legacy client from @brand-map/react-query-client/react.

Publishing Notes

The source package is private and is not meant to be published directly. Build first and publish the generated dist package:

bun run --cwd react-query build
cd react-query/dist
npm publish --tag next --access public

Publish the matching @brand-map/ts-client version first, because this package depends on it exactly.