iddirective finds id fields with no @id directive and arguments in your GraphQL schema files.
input NoIdDirectiveMutationInput {
name: String!
adminID: ID! # want "adminID has no id directive"
}A runnable linter can be created with multichecker package. You can create own linter with your favorite Analyzers.
package main
import (
"flag"
"github.com/gqlgo/iddirective"
"github.com/gqlgo/gqlanalysis/multichecker"
)
func main() {
multichecker.Main(
iddirective.Analyzer(),
)
}iddirective provides a typical main function and you can install with go install command.
$ go install github.com/gqlgo/iddirective/cmd/iddirective@latestThe iddirective command has a flag, schema which will be parsed and analyzed by iddirective's Analyzer.
$ iddirective -schema="server/graphql/schema/**/*.graphql"The default value of schema is "schema/*/**.graphql".
