# @jaredpalmer/graphql-codegen-golang

> Graphql Code Generator plugin for generating Golang

Latest version **1.1.0** (published 2021-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jaredpalmer/graphql-codegen-golang
pnpm add @jaredpalmer/graphql-codegen-golang
yarn add @jaredpalmer/graphql-codegen-golang
bun add @jaredpalmer/graphql-codegen-golang
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-05-08 |
| First published | 2021-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 33.8 KB |
| Known vulnerabilities | 0 (+18 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | jaredpalmer |
| Keywords | graphql-codegen, graphql, golang |

## Links

- npm: https://www.npmjs.com/package/@jaredpalmer/graphql-codegen-golang
- Repository: https://github.com/ctison/graphql-codegen-golang
- npm.io page: https://npm.io/package/@jaredpalmer/graphql-codegen-golang

## Dependencies (2)

- [liquidjs](https://npm.io/package/liquidjs.md) ^9.15.0
- [@graphql-codegen/plugin-helpers](https://npm.io/package/@graphql-codegen/plugin-helpers.md) ^1.17.8

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-05-08
- 1.0.1 — 2021-05-08
- 1.0.0 — 2021-05-03

## README

# 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:

- [bytes](https://pkg.go.dev/bytes)
- [encoding/json](https://pkg.go.dev/encoding/json)
- [fmt](https://pkg.go.dev/fmt)
- [net/http](https://pkg.go.dev/net/http)
- [io/ioutil](https://pkg.go.dev/io/ioutil)
- [strings](https://pkg.go.dev/strings)

## Install

The package is published to [@jaredpalmer/graphql-codegen-golang](https://www.npmjs.com/package/@jaredpalmer/graphql-codegen-golang).

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

## Usage: `codegen.yaml`

```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](src/config.ts)

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

## License

MIT

---
_Source: https://npm.io/package/@jaredpalmer/graphql-codegen-golang · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
