1.0.1 • Published 6 years ago
sort-graphql-sdl v1.0.1
sort-graphql-sdl
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