Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gqlgo/operationname
print operation name in your GraphQL query files
https://github.com/gqlgo/operationname
Last synced: about 2 months ago
JSON representation
print operation name in your GraphQL query files
- Host: GitHub
- URL: https://github.com/gqlgo/operationname
- Owner: gqlgo
- License: mit
- Created: 2022-10-21T05:40:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-21T15:39:23.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T00:37:47.475Z (3 months ago)
- Language: Go
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# operationname
[![pkg.go.dev][gopkg-badge]][gopkg]
`operationname` print operation name in your GraphQL query files.
```graphql
# Query
query GetUser {
user {
name
}
}mutation UpdateUser($name: String!) {
updateUser(name: $name) {
id
name
}
}
```## Usage
```sh
$ go install github.com/gqlgo/operationname/cmd/operationname@latest
```The `operationname` command has two flags, `schema` and `query` which will be parsed and analyzed by operationname's Analyzer.
```sh
$ operationname -schema="server/graphql/schema/**/*.graphql" -query="client/**/*.graphql"
GetUser
UpdateUser
```The default value of `schema` is "schema/*/**.graphql" and `query` is `query/*/**.graphql`.
`schema` flag accepts URL for a endpoint of GraphQL server.
`operationname` will get schemas by an introspection query via the endpoint.```sh
$ operationname -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/operationname
[gopkg-badge]: https://pkg.go.dev/badge/github.com/gqlgo/operationname?status.svg