Catalog npm
PACKAGE EXPLORERView in registry

@0no-co/graphql.web

npm

A spec-compliant client-side GraphQL implementation

client-side graphqlgraphqlgraphql-js
Versions collected56
Direct dependencies31From release 1.3.4
Last observed20 Oct, 22:13 UTC

README

Current package documentation

@0no-co/graphql.web

The spec-compliant minimum of client-side GraphQL.

CI Status Bundlesize Discord

@0no-co/graphql.web is a utility library, aiming to provide the minimum of functions that typical GraphQL clients need and would usually import from graphql, e.g. a GraphQL query parser, printer, and visitor.

While its goal isn’t to be an exact match to the GraphQL.js API it aims to remain API- and type-compatible where possible and necessary. However, its goal is to provide the smallest implementation for common GraphQL utilities that are still either spec-compliant or compatible with GraphQL.js’ implementation.

Note: If you’re instead looking for a drop-in replacement for the graphql package that you can just alias into your web apps, read more about the graphql-web-lite project, which uses this library to shim the graphql package.

@urql/core depends on this package to power its GraphQL query parsing and printing. If you’re using @urql/core@^4 you’re already using this library! ✨

Overview

@0no-co/graphql.web aims to provide a minimal set of exports to implement client-side GraphQL utilities, mostly including parsing, printing, and visiting the GraphQL AST, and the GraphQLError class.

Currently, graphql.web compresses to under 4kB and doesn’t regress on GraphQL.js’ performance when parsing, printing, or visiting the AST.

For all primary APIs we aim to hit 100% test coverage and match the output, types, and API compatibility of GraphQL.js, including — as far as possible — TypeScript type compatibility of the AST types with the currently stable version of GraphQL.js.

API

Currently, only a select few exports are provided — namely, the ones listed here are used in @urql/core, and we expect them to be common in all client-side GraphQL applications.

ExportDescriptionLinks
parseA tiny (but compliant) GraphQL query language parser.Source
printA (compliant) GraphQL query language printer.Source
visitA recursive reimplementation of GraphQL.js’ visitor.Source
KindThe GraphQL.js’ Kind enum, containing supported ASTNode kinds.Source
GraphQLErrorGraphQLError stripped of source/location debugging.Source
valueFromASTUntypedCoerces AST values into JS values.Source

The stated goals of any reimplementation are:

  1. Not to implement any execution or type system parts of the GraphQL specification.
  2. To adhere to GraphQL.js’ types and APIs as much as possible.
  3. Not to implement or expose any rarely used APIs or properties of the GraphQL.js library.
  4. To provide a minimal and maintainable subset of GraphQL.js utilities.

Therefore, while we can foresee implementing APIs that are entirely separate and unrelated to the GraphQL.js library in the future, for now the stated goals are designed to allow this library to be used by GraphQL clients, like @urql/core.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 56

Collected releases
VersionPublishedDirect dependenciesOpen version
1.3.4Registry latest21 Aug 202631
1.3.327 Jul 202631
1.3.213 Jun 202631
1.3.113 Jun 202631
1.3.013 Jun 202631
1.2.029 Jul 202531
1.2.0-canary-85c8743265b341d285a4ea3a3cdf12611a13846c29 Jul 202531
1.1.23 Mar 202531
1.1.2-canary-840e5b4eeb60996279770050ffde4a9f5df7129c3 Mar 202531
1.1.113 Feb 202531
1.1.1-canary-9e9501690a46b249a2d9c7301b91ad7382b5e2b313 Feb 202531
1.1.013 Feb 202531
1.1.0-canary-2984e7be4859ae53671646c15d1df5943c34199b13 Feb 202531
1.0.136 Jan 202531
1.0.13-canary-3bfd9ca0ae7906787a55787f03320d05fdead5426 Jan 202531
1.0.127 Dec 202431
1.0.12-canary-405d23c28a88f56efcf3606ff4b68881ad471a367 Dec 202431
1.0.112 Nov 202431
1.0.11-canary-0758d4f35edd23e16e21141e2052fe3437ed17aa2 Nov 202431
1.0.1031 Oct 202431

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0no-co/graphql.web

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5edc8d384b46b1162776f933ad1340a8ee7d4e6398866ea56083a31472796da5