1.0.1 • Published 6 years ago

sort-graphql-sdl v1.0.1

Weekly downloads
16
License
-
Repository
github
Last release
6 years ago

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
1.0.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago