New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sort-graphql-schema

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-graphql-schema

Sort JSON GraphQL schemas for commit consistency

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
245
decreased by-77.63%
Maintainers
3
Weekly downloads
 
Created
Source

Sort GraphQL Schema

npm version Build Status Coverage Status PRs Welcome

Sort JSON GraphQL schemas for commit consistency. Useful when using Relay with non-deterministically auto-generated schemas.

Installation

Runs on Node v6 or higher.

npm install sort-graphql-schema --save-dev

or install globally for CLI usage:

npm install -g sort-graphql-schema

Usage

API:

const fs = require('fs')
const { graphql } = require('graphql');
const { introspectionQuery } = require('graphql/utilities');
const sortSchema = require('sort-graphql-schema');
const schema = require('./path/to/schema');

graphql(schema, introspectionQuery)
.then(result => {
  fs.writeFileSync('/path/to/output.json', JSON.stringify(sortSchema(result), null, 2));

  console.log('Done!');
});

CLI:

sort-graphql-schema schema.json

Contributing

Yes, thank you. Please lint, update/write tests and add your name to the package.json file before you PR.

License

MIT

Keywords

FAQs

Package last updated on 19 Mar 2017

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