An experimental, opinionated GraphQL client library focused on server-persisted queries, type safety, and minimizing GraphQL usage in client code. Current version 0.0.7 is WIP and not for production. It leverages graphql-normalize and offers React hooks for persisted queries, mutations, and subscriptions. Key differentiators: no client-side graphql dependency, fully persisted operations, and built-in type safety with TypeScript declarations. The package is pre-1.0 and APIs are subject to breaking changes.
npm install graphql-persistedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a GraphQLQueryCache instance and using the usePersistedQuery hook to fetch a named persisted query.
Pin to exact version and lockfile; check changelog before upgrades.
Use named import syntax: import { ... } from 'graphql-persisted'Install peer deps: npm install graphql immer react
Stay updated with API changes; constructor args may change.
Change import to: import { usePersistedQuery } from 'graphql-persisted'Run: npm install graphql
Import named export: import { GraphQLQueryCache } from 'graphql-persisted'