@jaredpalmer/graphql-codegen-golang
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

  • [x] Generate types
  • [x] Generate queries and mutations
  • [x] 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

Name Default Description
packageName graphql Name of the generated Golang package.

License

MIT

Package Sidebar

Install

npm i @jaredpalmer/graphql-codegen-golang

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

34.7 kB

Total Files

13

Last publish

Collaborators

  • jaredpalmer