optionalschema

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 2 Imported by: 0

README

optionalschema

pkg.go.dev

optionalschema finds optional fields and arguments in your GraphQL schema files.

type Query {
    field: String!
    optionalField: String # want "optionalField is optional"
}

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

func main() {
	var excludes string
	flag.StringVar(&excludes, "excludes", "", "exclude GraphQL schema type name. it can specify multiple values separated by `,`")
	flag.Parse()

	multichecker.Main(
		optionalschema.Analyzer(excludes),
	)
}

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

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

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

$ optionalschema -schema="server/graphql/schema/**/*.graphql" -excludes="field1,field2"

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

Author

Appify Technologies, Inc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyzer

func Analyzer(excludes 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