constraintdirective

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 3 Imported by: 0

README

constraintdirective

pkg.go.dev

constraintdirective finds fields and arguments without @constraint directive in your GraphQL schema files.

input MutationInput {
    name: String! @constraint(minLength: 1)
    field: String! # want "field has no constraint directive"
}

How to use

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/constraintdirective"
	"github.com/gqlgo/gqlanalysis/multichecker"
)

func main() {
	multichecker.Main(
		constraintdirective.Analyzer(),
	)
}

constraintdirective provides a typical main function and you can install with go install command.

$ go install github.com/gqlgo/constraintdirective/cmd/constraintdirective@latest

The constraintdirective command has a flag, schema which will be parsed and analyzed by constraintdirective's Analyzer.

$ constraintdirective -schema="server/graphql/schema/**/*.graphql"

The default value of schema is "schema/*/**.graphql".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyzer

func Analyzer(types, excludeFieldNames []string) *gqlanalysis.Analyzer

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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