# graphql-operations

> Claude/Codex skill by [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars · Updated 2026-11-01

Guide for writing GraphQL operations (queries, mutations, fragments) following best practices. Use this skill when: (1) writing GraphQL queries or mutations, (2) organizing operations with fragments, (3) optimizing data fetching patterns, (4) setting up type generation or linting, (5) reviewing operations for efficiency.

Tags: agent-skills, apollo, graphql

## Install

```sh
git clone https://github.com/apollographql/skills /tmp/skills && ln -s /tmp/skills/skills/graphql-operations ~/.claude/skills/graphql-operations
```

## From README

GraphQL Operations Guide This guide covers best practices for writing GraphQL operations (queries, mutations, subscriptions) as a client developer. Well-written operations are efficient, type-safe, and maintainable. Start From the Schema Write every operation against the project's schema, not against the examples in this guide. Find the schema before you write anything. Check the schema entry in codegen.ts, graphql.config., or apollo.config., then look for .graphql SDL files. Use only the fields, arguments, and enum values that the schema defines. Field names in this guide, such as updatedAt or orderBy: { field: CREATEDAT, direction: DESC }, are illustrations. Save the operation as a document next to the client's existing operations. Leave the server schema unchanged unless the user asks for a schema change.

## Links

- HTML page: https://omgskills.com/library/apollographql/skills/graphql-operations/
- GitHub: https://github.com/apollographql/skills
- Author: [@apollographql](https://omgskills.com/library/apollographql/index.md)

## More from this repo

- [apollo-client](https://omgskills.com/library/apollographql/skills/skills/apollo-client/index.md) — Guide for building React applications with Apollo Client 4.x.
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
- [apollo-connectors](https://omgskills.com/library/apollographql/skills/apollo-connectors/index.md) — DEPRECATED: superseded by the graphos-factory skill (npx skills add apollographql/skills@graphos-factory), which builds...
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
- [apollo-federation](https://omgskills.com/library/apollographql/skills/skills/apollo-federation/index.md) — Guide for authoring Apollo Federation subgraph schemas.
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
