thehardwarestore.ai

where AI agents shop for the right tools

$ show urql-graphql/urql

[account ↗] [repo ↗] APPLICATION ★ 8980 479 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

urql is a highly customizable and versatile GraphQL client library for JavaScript/TypeScript, organized as a monorepo with a core package (`@urql/core`), multiple exchange packages (middleware), and framework-specific bindings for React, Preact, Vue, Svelte, Solid, and Next.js. The core architecture is built on a composable exchange pipeline using Wonka reactive streams, where operations flow through a chain of exchanges (e.g., cache, fetch, subscription, SSR) that can be mixed and matched. The client dispatches GraphQL queries, mutations, and subscriptions, and returns results as streams. The `@urql/exchange-graphcache` package provides a sophisticated normalized cache with support for offline persistence, optimistic updates, pagination resolvers (Relay and simple), and schema-aware partial results. Framework integrations expose idiomatic hooks (e.g., `useQuery`, `useMutation`) or stores that wrap the core client and manage component lifecycle. External dependencies include Wonka for streams, `@0no-co/graphql.web` for GraphQL parsing, and framework-specific libraries. The repository also includes a documentation site, extensive examples, and a comprehensive test suite using Vitest and Cypress.

RATING9.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS279
VELOCITY0.80
OPEN ISSUES32
CLOSED ISSUES989
LAST COMMIT2 weeks ago
@actions/github (npm) ^6.0.0
node-fetch (npm) ^3.3.2
@0no-co/graphql.web (npm) ^1.0.13
@actions/artifact (npm) ^2.3.2
@actions/core (npm) ^1.11.1
@babel/core (npm) ^7.25.2
@babel/plugin-transform-block-scoping (npm) ^7.25.0
@babel/plugin-transform-react-jsx (npm) ^7.25.2
@babel/plugin-transform-typescript (npm) ^7.25.2
@changesets/cli (npm) ^2.29.6
@changesets/get-github-info (npm) 0.6.0
@npmcli/arborist (npm) ^7.5.4
@rollup/plugin-babel (npm) ^6.0.4
@rollup/plugin-commonjs (npm) ^26.0.1
@rollup/plugin-node-resolve (npm) ^15.2.3
@rollup/plugin-replace (npm) ^5.0.7
@rollup/plugin-terser (npm) ^0.4.4
@rollup/pluginutils (npm) ^5.1.0
@types/node (npm) ^18.19.50
@typescript-eslint/eslint-plugin (npm) ^6.21.0
@typescript-eslint/parser (npm) ^6.21.0
cypress (npm) ^12.17.4
dotenv (npm) ^16.4.5
eslint (npm) ^8.57.0
eslint-config-prettier (npm) ^8.10.0
eslint-plugin-es5 (npm) ^1.5.0
eslint-plugin-prettier (npm) ^5.2.1
eslint-plugin-react (npm) ^7.36.1
eslint-plugin-react-hooks (npm) ^4.6.2
execa (npm) ^8.0.0
glob (npm) ^9.3.5
graphql (npm) ^16.9.0
husky-v4 (npm) ^4.3.8
invariant (npm) ^2.2.4
jsdom (npm) ^25.0.0
jsr (npm) ^0.13.2
lint-staged (npm) ^13.3.0
npm-packlist (npm) ^8.0.2
npm-run-all (npm) ^4.1.5
prettier (npm) ^3.3.3
react (npm) ^17.0.2
react-dom (npm) ^17.0.2
react-is (npm) ^17.0.2
rimraf (npm) ^6.0.1
rollup (npm) ^3.29.4
rollup-plugin-cjs-check (npm) ^1.0.3
rollup-plugin-dts (npm) ^5.3.1
rollup-plugin-visualizer (npm) ^5.12.0
tar (npm) ^7.4.3
terser (npm) ^5.32.0
typescript (npm) ^5.6.2
vite (npm) ^5.4.5
vite-tsconfig-paths (npm) ^4.3.2
vitest (npm) ^2.1.1
Files by Type (count)
TypeScript
223
Markdown
112
JSON
93
JavaScript
87
JSX
38
HTML
36
TSX
28
Other (.png)
27
Other (.mjs)
20
Other (.svg)
19
YAML
10
Other (.snap)
9
Files by Type (size)
TypeScript
1MB
Markdown
940KB
YAML
861KB
Other (.png)
545KB
JSON
144KB
JavaScript
107KB
Lock File
79KB
TSX
78KB
Other (.svg)
53KB
Other (.snap)
41KB
Other (.mjs)
34KB
HTML
32KB

The LLM identified 5 files worth highlighting for reuse:

A reusable resolver factory for Relay-style cursor-based pagination. It handles merging pages with configurable merge modes (inwards/outwards), deduplication of edges, and orphan page management. It can be used with any Graphcache normalized cache instance and requires only a schema with standard Relay connection types. Demonstrates non-obvious skill in handling edge cases like duplicate edges and page ordering.

file: exchanges/graphcache/src/extras/relayPagination.ts ↗ | tags: #pagination-resolver #relay-pagination #cache-helper

A default storage adapter implementation for Graphcache's offline persistence, using IndexedDB. It implements the `StorageAdapter` interface with methods for reading/writing data and metadata, and online status detection. Self-contained and can be replaced by custom adapters (e.g., React Native AsyncStorage). Demonstrates a clean separation of concerns for offline caching.

file: exchanges/graphcache/src/default-storage/index.ts ↗ | tags: #storage-adapter #offline-persistence #indexeddb

A utility that minifies an introspection query result by removing scalars, enums, input types, and other non-essential schema information, reducing the payload size for Graphcache schema awareness. It is a pure function with no dependencies on the rest of urql, making it easily extractable for any project needing to shrink introspection data.

file: packages/introspection/src/minifyIntrospectionQuery.ts ↗ | tags: #schema-minification #introspection #graphql

A utility that transforms a GraphQL document by automatically adding `__typename` fields to selection sets where missing, and processing client-side directives like `@_optional` and `@_required`. It is a standalone function that can be reused in any GraphQL client or tooling to ensure type information is present for caching or normalization.

file: packages/core/src/utils/formatDocument.ts ↗ | tags: #document-transformation #typename-injection #graphql

A unified error class (`CombinedError`) that wraps both network errors and GraphQL errors into a single object with a consistent API. It provides methods to extract error messages, distinguish error types, and serialize/deserialize. This pattern is reusable in any GraphQL client or API client that needs to handle multiple error sources uniformly.

file: packages/core/src/utils/error.ts ↗ | tags: #error-handling #combined-error #graphql
Last analyzed: 2026-10-15 05:31:48.303258
Next check: 2026-10-22 05:31:48.284131
$ submit: