Skip to content

Commit

Permalink
Merge pull request #2 from gqlgo/add-more-usage
Browse files Browse the repository at this point in the history
Add descriptions to README more.
  • Loading branch information
tenntenn authored Apr 7, 2021
2 parents 5689785 + d65c2b9 commit 50c1f2c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ query GetA() {
## How to use

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

```go
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!
)
}
```
Expand All @@ -37,6 +41,21 @@ func main() {
$ 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"
```

<!-- links -->
[gopkg]: https://pkg.go.dev/github.com/gqlgo/lackid
[gopkg-badge]: https://pkg.go.dev/badge/github.com/gqlgo/lackid?status.svg

0 comments on commit 50c1f2c

Please sign in to comment.