Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.17 KB

README.md

File metadata and controls

53 lines (38 loc) · 1.17 KB

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.