npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@0no-co/graphql.web

v1.0.11

Published

A spec-compliant client-side GraphQL implementation

Downloads

3,244,403

Readme

@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.

| Export | Description | Links | | --------------------- | ------------------------------------------------------------------ | -------------------------- | | parse | A tiny (but compliant) GraphQL query language parser. | Source | | print | A (compliant) GraphQL query language printer. | Source | | visit | A recursive reimplementation of GraphQL.js’ visitor. | Source | | Kind | The GraphQL.js’ Kind enum, containing supported ASTNode kinds. | Source | | GraphQLError | GraphQLError stripped of source/location debugging. | Source | | valueFromASTUntyped | Coerces 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.