1.1.0 • Published 3 years ago

@jaredpalmer/graphql-codegen-golang v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

GraphQL Code Generator plugin for Golang

This package is a fork of ctison/graphql-codegen-golang with support for GraphQL fragments. It does not support subscriptions

Roadmap

  • Generate types
  • Generate queries and mutations
  • Generate fragments
  • Generate subscriptions
  • Allow api client to accept a global http options (e.g. authorization header for a bearer token)

This package generates Golang types and requests which use:

Install

The package is published to @jaredpalmer/graphql-codegen-golang.

npm install -D @jaredpalmer/graphql-codegen-golang
yarn install -D @jaredpalmer/graphql-codegen-golang

Usage: codegen.yaml

schema: pkg/graphql/schema.graphql
documents: pkg/graphql/!(schema).graphql
generates:
  pkg/graphql/graphql.go:
    hooks:
      afterOneFileWrite: go fmt
    plugins:
      - graphql-codegen-golang:
          packageName: graphql # default

Configuration

Configuration source is at src/config.ts

NameDefaultDescription
packageNamegraphqlName of the generated Golang package.

License

MIT