# Go GraphQL

> Go GraphQL is an open-source agent skill for developer tools. Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(architecture)/go-graphql
- **Repository:** https://github.com/eduardo-sl/go-agent-skills
- **GitHub stars:** 90
- **License:** MIT
- **Skill name:** go-graphql
- **Collection:** https://github.com/eduardo-sl/go-agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an agent a structured approach to building and reviewing GraphQL APIs in Go using gqlgen. It starts from a schema-first workflow: the agent is steered to generate code from the .graphql schema, bind generated types to existing domain models, keep resolvers thin, and never edit generated files.

The bulk of the guidance targets performance and safety. It explains how to batch field lookups with dataloaders that are created per request, so list queries avoid one database call per element. It also covers bounding public endpoints with complexity and depth limits, mandatory pagination, introspection control, and persisted queries. Error handling is addressed through an error presenter that hides internal details and a panic recovery hook, and authorization is enforced per field using the principal in the request context.

The skill ends with a verification checklist and points to a reference file with examples for error presentation, field-level authorization directives and resolver tests that assert query counts. It expects a Go toolchain and uses gqlgen as a Go module tool.

## When your agent uses it

> Build GraphQL servers in Go with gqlgen: schema-first generation, resolver structure, the N+1 problem and dataloaders, complexity and depth limits, error presentation, field-level authorization, and testing resolvers. Use when implementing or reviewing a GraphQL API, when a query fans out into hundreds of database calls, or when deciding what a resolver may expose. Trigger examples: "GraphQL", "gqlgen", "resolver", "N+1 queries", "dataloader", "query complexity limit", "GraphQL schema". Not for: REST and OpenAPI (go-openapi), gRPC (go-grpc), general HTTP middleware and shutdown (go-api-design).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-graphql)
- [Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*), Bash(gqlgen:*)](https://github.com/eduardo-sl/go-agent-skills/blob/HEAD/skills/(architecture)/go-graphql/SKILL.md)
- [License: MIT](https://github.com/eduardo-sl/go-agent-skills/tree/HEAD/skills/(architecture)/go-graphql)

## Features

- **Schema-first code generation:** Covers generating models and resolver stubs from the GraphQL schema with gqlgen and binding them to domain types.
- **Dataloader batching:** Explains how to collect field lookups into single batched queries per request and keep results in key order.
- **Query complexity and depth limits:** Describes cost-based complexity limits, recursion depth bounds, persisted queries and introspection control.
- **Error presentation:** Shows how to map domain errors to safe client messages and recover from resolver panics without leaking internals.
- **Field-level authorization:** Describes enforcing access checks per field using the authenticated principal from the request context.
- **Resolver testing:** Covers testing the schema through a test client and asserting query counts to catch N+1 regressions.

## Good for

- Set up a new gqlgen GraphQL server in a Go project
- Fix a GraphQL query that triggers hundreds of database calls
- Add a complexity limit to a public GraphQL endpoint
- Review a resolver for fields that expose data to the wrong users
- Write tests that check resolver query counts

## Install

### Any agent

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

## FAQ

### What does the skill need to run?

It requires the Go toolchain, and gqlgen is installed as a module tool in the project.

### Does Go GraphQL install gqlgen or change my code automatically?

It guides the agent through commands such as go tool gqlgen init and generate, along with conventions for resolvers, loaders and limits. Its allowed tools include Read, Edit, Write and Go-related shell commands.

### When should the skill be used?

It is meant for implementing or reviewing a GraphQL API, for queries that fan out into many database calls, and for deciding what a resolver may expose. It is not meant for REST, gRPC or general HTTP middleware, which are covered by other skills.

### Does Go GraphQL run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Go GraphQL?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Go GraphQL?

The closest alternatives to Go GraphQL are API GraphQL GRPC, Go database, Go backend, Go openapi and Go API design.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [API GraphQL GRPC](https://ai-powered.com/skills/api-graphql-grpc): API GraphQL GRPC is an open-source agent skill for developer tools.
- [Go database](https://ai-powered.com/skills/go-database): Go database is an open-source agent skill for databases.
- [Go backend](https://ai-powered.com/skills/go-backend): Go backend is an open-source agent skill for developer tools.
- [Go openapi](https://ai-powered.com/skills/go-openapi): Go openapi is an open-source agent skill for developer tools.
- [Go API design](https://ai-powered.com/skills/go-api-design): Go API design is an open-source agent skill for developer tools.
- [Go GRPC](https://ai-powered.com/skills/go-grpc): Go GRPC is an open-source agent skill for developer tools.
- [Developing genkit go](https://ai-powered.com/skills/developing-genkit-go): Developing genkit go is an open-source agent skill for developer tools.
- [Go performance review](https://ai-powered.com/skills/go-performance-review): Go performance review is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/go-graphql
