lackid

package module
v0.1.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: 1

README

lackid

pkg.go.dev

lackid finds a selection for a type which has id field but the selection does not have id.

query GetA() {
    a { # want "type A has id field but selection a does not have id field"
	name
    }
}

How to use

A runnable linter can be created with multichecker package. You can create own linter with your favorite Analyzers.

package main

import (
        "github.com/gqlgo/awesomeanalyzer"            // It is an example. It does not exist actually.
        "github.com/gqlgo/gqlanalysis/multichecker"
        "github.com/gqlgo/lackid"
)

func main() {
        multichecker.Main(
		awesomeanalyzer.Analyzer,
		lackid.Analyzer,
		// You can add more Analyzers!
	)
}

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

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

The lackid command has two flags, schema and query which will be parsed and analyzed by lackid's Analyzer.

$ lackid -schema="server/graphql/schema/**/*.graphql" -query="client/**/*.graphql"

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

schema flag accepts URL for a endpoint of GraphQL server. lackid will get schemas by an introspection query via the endpoint.

$ lackid -schema="https://example.com" -query="client/**/*.graphql"

Author

Appify Technologies, Inc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &gqlanalysis.Analyzer{
	Name: "lackid",
	Doc:  "lackid finds a selection for a type which has id field but the selection does not have id",
	Run:  run,
}

Functions

This section is empty.

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