Socket
Book a DemoInstallSign in
Socket

sort-graphql-sdl

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-graphql-sdl

Sort GraphQL schema definition language (SDL) document.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

sort-graphql-sdl

GitSpo Mentions Travis build status Coveralls NPM version Canonical Code Style Twitter Follow

Sort GraphQL schema definition language (SDL) document.

Behaviour

Alphabetically sorts definitions and fields.

Example

Input:

type Query {
  bananas: [Banana!]!
  apples: [Apple!]!
}

type Apple {
  name: String!
  id: ID!
}

type Banana {
  name: String!
  id: ID!
}

Output:

type Apple {
  id: ID!
  name: String!
}

type Banana {
  id: ID!
  name: String!
}

type Query {
  apples: [Apple!]!
  bananas: [Banana!]!
}

Usage

$ sort-graphql-sdl --help
Sort GraphQL schema definition language (SDL) document.
Usage: sort-graphql-sdl -f <sdl-path>

Options:
  --version   Show version number                                      [boolean]
  --help      Show help                                                [boolean]
  --sdl-path  Path to the GraphQL schema definition (SDL) document.
                                                             [string] [required]
  --write     Overrides contents of the SDL document.        [string] [required]

$ # Prints formatted schema.
$ sort-graphql-sdl ./schema.graphql
$
$ # Overrides target schema.
$ sort-graphql-sdl --write ./schema.graphql

Keywords

graphql

FAQs

Package last updated on 27 Oct 2019

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