Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gql-compress

Package Overview
Dependencies
Maintainers
10
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gql-compress

Shrink your GraphQL

  • 2.0.24
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
638
decreased by-27.5%
Maintainers
10
Weekly downloads
 
Created
Source

gql-compress

Shrink your GraphQL

npm version](https://npm.im/gql-compress) CircleCI Coverage Status


Installation

npm i gql-compress

Usage

import compress from 'gql-compress'

const uncompressed = `
  query {
    repository(owner:"octocat", name:"Hello-World") {
      issues(last:20, states:CLOSED) {
        edges {
          node {
            title
            url
            labels(first:5) {
              edges {
                node {
                  name
                }
              }
            }
          }
        }
      }
    }
  }
` // 357 bytes

const compressed = compress(uncompressed) // 147 bytes
// outputs: "query{repository(owner:\"octocat\",name:\"Hello-World\"){issues(last:20,states:CLOSED){edges{node{title url labels(first:5){edges{node{name}}}}}}}}"

Example from GitHub.

MIT

Keywords

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc