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

@fluxwp/graphql

v0.4.0

Published

@fluxwp/graphql (FluxWP)

Readme

@fluxwp/graphql

Typed client for Flux GraphQL (/graphql, plugin flx-graphql). Every screen (wp-admin, FluxWP desktop, mobile, headless) uses the same generated operations and types.

Writing an operation

  1. Put the operation in the plugin that ships it: plugins/<slug>/graphql/operations/<name>.graphql. Name it PascalCase with the Flx prefix (FlxTasksList); fragments are shared inside the plugin.
  2. bun run --filter @fluxwp/graphql generate (also run by bun install) writes:
    • src/generated/operations.ts: one FlxOperation<Result, Variables> constant per operation (not committed);
    • src/generated/types.ts: result, variable, input and enum types (not committed);
    • plugins/<slug>/graphql/persisted-queries.json: { sha256: document } (committed: the plugin ships it).
  3. The plugin registers its manifest so the server runs the operation by id:
add_filter( 'flx_gql_persisted_manifests', function ( $m ) {
	$m['flx-tasks'] = FLXG_DIR . 'graphql/persisted-queries.json';
	return $m;
} );

Using it

import { createGraphQLClient } from '@fluxwp/graphql';
import { FlxGraphQLProvider, useFlxQuery, useFlxMutation } from '@fluxwp/graphql/react';
import { FlxTasksList, FlxTaskSave } from '@fluxwp/graphql/operations';

const gql = createGraphQLClient({ api }); // api = the site's @fluxwp/core client
const data = await gql.request(FlxTasksList, { first: 20 });

// React: <FlxGraphQLProvider client={gql} scope={accountKey}> … </FlxGraphQLProvider>
const list = useFlxQuery(FlxTasksList, { first: 20 });
const save = useFlxMutation(FlxTaskSave);

Reads go out as GET /graphql?queryId=… (LiteSpeed can cache public ones), writes as POST. Errors throw FlxGraphQLError with code (FORBIDDEN, NOT_FOUND, …); input problems of a mutation come back in its payload's errors (payloadErrors() maps them to form fields).

Schema

The schema snapshot of a test site with every GraphQL package is split by owner, so parallel package pull requests never edit the same file:

| File | Holds | |---|---| | schema/core.graphql | WordPress / WPGraphQL types and anything without an owner | | plugins/<slug>/graphql/schema.graphql | the plugin's types; fields it adds to other types as extend type … | | themes/<slug>/graphql/schema.graphql | the same for a theme |

The kit records who registered each type and field (wp flx-gql schema --owners, Flux GraphQL 0.3.1); scripts/parts.ts splits and assembles. generate builds the full schema from the parts (schema/full.graphql, not committed).

bun run --filter @fluxwp/graphql schema                        # every part (needs PHP + wp-cli, tools/tests/wp-graphql/site.sh)
bun run --filter @fluxwp/graphql schema -- plugins/flx-tasks   # only that plugin's part
bun packages/graphql/scripts/schema-parts.ts assemble          # print the full schema

CI (.github/workflows/graphql.yml) regenerates the parts and fails when a package part is out of date (the CI parts are the graphql-schema-ci artifact; core.graphql only warns, it follows the WordPress release CI downloads), on a breaking change against the base commit unless the PR has the graphql-breaking label, when a committed manifest is stale, and when a client does not typecheck against the generated types.