graphql-schema-unused

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 8 Imported by: 0

README

graphql-schema-unused

Detect unused types in graphql schema.

Install

Download binaries from release pages.

Usage

Let's say you have the following "schema.graphql":

schema {
  query: Query
}

type Query {
  user(id: Int!): User
}

type User {
  name: String!
  age: Int!
}

type Animal {
  name: String!
}

Then:

❯ graphql-schema-unused schema.graphql
unused type Animal at schema.graphql line 14

❯ echo $?
1

If you want some types not to be detected as unused, then use -skip option:

❯ graphql-schema-unused -skip '^Animal$' schema.graphql

❯ echo $?
0

Author

Shoichi Kaji

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL