Catalog npm
Back to packageRELEASE DETAILS

0.0.0-canary-20230606153723

npm

@0no-co/graphql.web

A spec-compliant client-side GraphQL implementation

client-side graphqlgraphqlgraphql-js
Published6 Jun 2023
Direct dependencies27
Transitive dependenciesNot calculated

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.

Declared dependencies 28

Native requirements
27 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.0.3development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^8.36.0development
rimraf
Environment
{
  "local_name": "rimraf",
  "alias": false,
  "peer_metadata": null
}
^4.4.0development
rollup
Environment
{
  "local_name": "rollup",
  "alias": false,
  "peer_metadata": null
}
^3.19.1development
terser
Environment
{
  "local_name": "terser",
  "alias": false,
  "peer_metadata": null
}
^5.16.6development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^0.29.7development
graphql
Environment
{
  "local_name": "graphql",
  "alias": false,
  "peer_metadata": null
}
^16.6.0development
husky-v4
Environment
{
  "local_name": "husky-v4",
  "alias": false,
  "peer_metadata": null
}
^4.3.8development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.8.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.0.2development
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
^13.2.0development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.5development
@changesets/cli
Environment
{
  "local_name": "@changesets/cli",
  "alias": false,
  "peer_metadata": null
}
^2.26.0development
rollup-plugin-dts
Environment
{
  "local_name": "rollup-plugin-dts",
  "alias": false,
  "peer_metadata": null
}
^5.3.0development
@vitest/coverage-c8
Environment
{
  "local_name": "@vitest/coverage-c8",
  "alias": false,
  "peer_metadata": null
}
^0.29.7development
eslint-plugin-tsdoc
Environment
{
  "local_name": "eslint-plugin-tsdoc",
  "alias": false,
  "peer_metadata": null
}
^0.2.17development
@rollup/plugin-buble
Environment
{
  "local_name": "@rollup/plugin-buble",
  "alias": false,
  "peer_metadata": null
}
^1.0.2development
@rollup/plugin-terser
Environment
{
  "local_name": "@rollup/plugin-terser",
  "alias": false,
  "peer_metadata": null
}
^0.4.0development
@rollup/plugin-sucrase
Environment
{
  "local_name": "@rollup/plugin-sucrase",
  "alias": false,
  "peer_metadata": null
}
^5.0.1development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^8.7.0development
eslint-plugin-prettier
Environment
{
  "local_name": "eslint-plugin-prettier",
  "alias": false,
  "peer_metadata": null
}
^4.2.1development
@rollup/plugin-commonjs
Environment
{
  "local_name": "@rollup/plugin-commonjs",
  "alias": false,
  "peer_metadata": null
}
^24.0.1development
rollup-plugin-cjs-check
Environment
{
  "local_name": "rollup-plugin-cjs-check",
  "alias": false,
  "peer_metadata": null
}
^1.0.2development
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^5.55.0development
@changesets/get-github-info
Environment
{
  "local_name": "@changesets/get-github-info",
  "alias": false,
  "peer_metadata": null
}
^0.5.2development
@rollup/plugin-node-resolve
Environment
{
  "local_name": "@rollup/plugin-node-resolve",
  "alias": false,
  "peer_metadata": null
}
^15.0.1development
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^5.55.0development
graphql
Environment
{
  "local_name": "graphql",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
^14.0.0 || ^15.0.0 || ^16.0.0peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "f912b94b31da5d40a83119466914dfd19b808a2a",
  "tarball": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-0.0.0-canary-20230606153723.tgz",
  "fileCount": 8,
  "integrity": "sha512-Axaj27toFDzQA4UafvBnDxh4qRhJJe9XQ9OUbDXmy4tkWLCeAa/aHXBRqrw37ccQkvStI3+QJdKE7/UHKOBu5g==",
  "signatures": [
    {
      "sig": "MEUCIC3CrZulGRIlgFDiKaNwIQhYka07ZCmji852fXvwbH6sAiEA7Cww0c6sAPzX9KYUSyWO/3qWtGCch+v1iKOBEEcwkKU=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "attestations": {
    "url": "https://registry.npmjs.org/-/npm/v1/attestations/@0no-co%2fgraphql.web@0.0.0-canary-20230606153723",
    "provenance": {
      "predicateType": "https://slsa.dev/provenance/v0.2"
    }
  },
  "unpackedSize": 152943
}

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_version:0ea2ae8fac7faff8c3fcee16e35fa2ef62d6742e685672099ced4e4b93696f28

Other collected versions

1.3.421 Aug1.3.327 Jul1.3.213 Jun1.3.113 Jun1.3.013 Jun1.2.029 JulView all collected versions →