···
2
+
<h2>@0no-co/graphql.web</h2>
3
+
<strong>The spec-compliant minimum of client-side GraphQL.</strong>
6
+
<a href="https://github.com/0no-co/graphql.web/actions/workflows/release.yml">
7
+
<img alt="CI Status" src="https://github.com/0no-co/graphql.web/actions/workflows/release.yml/badge.svg?branch=main" />
9
+
<a href="https://npmjs.com/package/@0no-co/graphql.web">
10
+
<img alt="Bundlesize" src="https://deno.bundlejs.com/?q=@0no-co/graphql.web&badge" />
12
+
<a href="https://urql.dev/discord">
13
+
<img alt="Discord" src="https://img.shields.io/discord/1082378892523864074?color=7389D8&label&logo=discord&logoColor=ffffff" />
19
+
`@0no-co/graphql.web` is an **experimental** library, aiming to provide an
20
+
absolute minimum of features and exports of `graphql` utilities that typical
21
+
GraphQL web apps or GraphQL clients need.
23
+
While its goal isn’t to be an exact match to [the GraphQL.js
24
+
API](https://graphql.org/graphql-js/graphql/) it aims to provide API- and
25
+
type-compatible where possible and necessary. However, its goal is to provide
26
+
the smallest implementation for common GraphQL utilities that are still either
27
+
spec-compliant or compatible with GraphQL.js’ implementation.
29
+
> **Note:** While this library can be used as a drop-in replacement for
30
+
> `graphql` in _some cases_, the [`graphql-web-lite`
31
+
> project](https://github.com/0no-co/graphql-web-lite) is maintained to be
32
+
> a full shim/alias for the `graphql` package.
36
+
Currently, only a select few exports are provided — namely, the ones listed here
37
+
are used in `@urql/core`, and we expect them to be common in all client-side
38
+
GraphQL applications.
40
+
| Export | Description | Links |
41
+
| --- | ----------- | -------- |
42
+
| `parse` | A tiny (but compliant) GraphQL query language parser. | [Source](./src/parser.ts) |
43
+
| `print` | A (compliant) GraphQL query language printer. | [Source](./src/printer.ts) |
44
+
| `visit` | A recursive reimplementation of GraphQL.js’ visitor. | [Source](./src/printer.ts) |
45
+
| `Kind` | The GraphQL.js’ `Kind` enum, containing supported `ASTNode` kinds. | [Source](./src/kind.ts) |
46
+
| `GraphQLError` | `GraphQLError` stripped of source/location debugging. | [Source](./src/kind.ts) |
48
+
The stated goals of any reimplementation are:
49
+
1. Not to implement any execution or type system parts of the GraphQL
51
+
2. To adhere to GraphQL.js’ types and APIs as much as possible.
52
+
3. Not to implement or expose any rarely used APIs or properties of the
54
+
4. To provide a minimal and maintainable subset of GraphQL.js utilities.
56
+
Therefore, while we can foresee implementing APIs that are entirely separate and
57
+
unrelated to the GraphQL.js library in the future, for now the stated goals are
58
+
designed to allow this library to be used by GraphQL clients, like
59
+
[`@urql/core`](https://github.com/urql-graphql/urql).