Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gqlgo/lackid
Analyzer: lackid finds a selection for a type which has id field but the selection does not have id
https://github.com/gqlgo/lackid
graphql linter
Last synced: 14 days ago
JSON representation
Analyzer: lackid finds a selection for a type which has id field but the selection does not have id
- Host: GitHub
- URL: https://github.com/gqlgo/lackid
- Owner: gqlgo
- License: mit
- Created: 2021-04-07T15:08:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-16T07:49:14.000Z (about 2 years ago)
- Last Synced: 2024-08-02T06:13:51.903Z (4 months ago)
- Topics: graphql, linter
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 5
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lackid
[![pkg.go.dev][gopkg-badge]][gopkg]
`lackid` finds a selection for a type which has id field but the selection does not have id.
```graphql
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.```go
package mainimport (
"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.
```sh
$ 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.
```sh
$ 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.```sh
$ lackid -schema="https://example.com" -query="client/**/*.graphql"
```## Author
[![Appify Technologies, Inc.](appify-logo.png)](http://github.com/appify-technologies)
[gopkg]: https://pkg.go.dev/github.com/gqlgo/lackid
[gopkg-badge]: https://pkg.go.dev/badge/github.com/gqlgo/lackid?status.svg