Skip to content

print operation name in your GraphQL query files

License

Notifications You must be signed in to change notification settings

gqlgo/operationname

Repository files navigation

operationname

pkg.go.dev

operationname print operation name in your GraphQL query files.

# Query
query GetUser {
   user {
       name
   } 
}

mutation UpdateUser($name: String!) {
    updateUser(name: $name) {
        id
        name
    }
}

Usage

$ 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.

$ 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.

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

Author

Appify Technologies, Inc.

About

print operation name in your GraphQL query files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages