Expertise·API Development·v1.0.0

GraphQL Operations

Guide for writing GraphQL operations (queries, mutations, fragments) following best practices, including type generation and linting.

You say
Buy it · $89 Read it before you buy $89 Written by apollographql · unverified publisher
Context cost
10.7k tokensestimated from the bundle, loaded when it triggers
Bundle
6 files · 42.9 kBtext throughout, nothing executable
Licence
MITpaid listing
Last change
v1.0.0
Servers it uses
Noneruns standalone

What it does

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.

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Expertise

Domain judgement the base model does not have.

graphqlqueriesfragmentsclient
Filed under

API Development

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md4.5 kB · 245 lines
--- name: graphql-operations description: > 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. license: MIT compatibility: Any GraphQL client (Apollo Client, urql, Relay, etc.) metadata: author: apollographql version: "1.0.0" allowed-tools: Bash(npm:*) Bash(npx:*) Read Write Edit Glob Grep ---
18# GraphQL Operations Guide
19
20This guide covers best practices for writing GraphQL operations (queries, mutations, subscriptions) as a client developer. Well-written operations are efficient, type-safe, and maintainable.
21
22## Operation Basics
23
24### Query Structure
25
26```graphql
27query GetUser($id: ID!) {
28 user(id: $id) {
29 id
30 name
31 email
32 }
33}
34```
35
36### Mutation Structure
37
38```graphql
39mutation CreatePost($input: CreatePostInput!) {
40 createPost(input: $input) {
41 id
42 title
43 createdAt
44 }
45}
46```
47
48### Subscription Structure
49
50```graphql
51subscription OnMessageReceived($channelId: ID!) {
52 messageReceived(channelId: $channelId) {
53 id
54 content
55 sender {
56 id
57 name
58 }
59 }
60}
61```
62
63## Quick Reference
64
65### Operation Naming
66
67| Pattern | Example |
68| ------------ | ------------------------------------------- |
69| Query | GetUser, ListPosts, SearchProducts |
70| Mutation | CreateUser, UpdatePost, DeleteComment |
71| Subscription | OnMessageReceived, OnUserStatusChanged |
72
73### Variable Syntax
74
75```graphql
76# Required variable
77query GetUser($id: ID!) { ... }
78
79# Optional variable with default
80query ListPosts($first: Int = 20) { ... }
81
82# Multiple variables
83query SearchPosts($query: String!, $status: PostStatus, $first: Int = 10) { ... }
84```
85
86### Fragment Syntax
87
88```graphql
89# Define fragment
90fragment UserBasicInfo on User {
91 id
92 name
93 avatarUrl
94}
95
96# Use fragment
97query GetUser($id: ID!) {
98 user(id: $id) {
99 ...UserBasicInfo
100 email
101 }
102}
103```
104
105### Directives
106
107```graphql
108query GetUser($id: ID!, $includeEmail: Boolean!) {
109 user(id: $id) {
110 id
111 name
112 email @include(if: $includeEmail)
113 }
114}
115
116query GetPosts($skipDrafts: Boolean!) {
117 posts {
118 id
119 title
120 draft @skip(if: $skipDrafts)
121 }
122}
123```
124
125## Key Principles
126
127### 1. Request Only What You Need
128
129```graphql
130# Good: Specific fields
131query GetUserName($id: ID!) {
132 user(id: $id) {
133 id
134 name
135 }
136}
137
138# Avoid: Over-fetching
139query GetUser($id: ID!) {
140 user(id: $id) {
141 id
142 name
143 email
144 bio
145 posts {
146 id
147 title
148 content
149 comments {
150 id
151 }
152 }
153 followers {
154 id
155 name
156 }
157 # ... many unused fields
158 }
159}
160```
161
162### 2. Name All Operations
163
164```graphql
165# Good: Named operation
166query GetUserPosts($userId: ID!) {
167 user(id: $userId) {
168 posts {
169 id
170 title
171 }
172 }
173}
174
175# Avoid: Anonymous operation
176query {
177 user(id: "123") {
178 posts {
179 id
180 title
181 }
182 }
183}
184```
185
186### 3. Use Variables, Not Inline Values
187
188```graphql
189# Good: Variables
190query GetUser($id: ID!) {
191 user(id: $id) {
192 id
193 name
194 }
195}
196
197# Avoid: Hardcoded values
198query {
199 user(id: "123") {
200 id
201 name
202 }
203}
204```
205
206### 4. Colocate Fragments with Components
207
208```tsx
209// UserAvatar.tsx
210export const USER_AVATAR_FRAGMENT = gql`
211 fragment UserAvatar on User {
212 id
213 name
214 avatarUrl
215 }
216`;
217
218function UserAvatar({ user }) {
219 return <img src={user.avatarUrl} alt={user.name} />;
220}
221```
222
223## Reference Files
224
225Detailed documentation for specific topics:
226
227- [Queries](references/queries.md) - Query patterns and optimization
228- [Mutations](references/mutations.md) - Mutation patterns and error handling
229- [Fragments](references/fragments.md) - Fragment organization and reuse
230- [Variables](references/variables.md) - Variable usage and types
231- [Tooling](references/tooling.md) - Code generation and linting
232
233## Ground Rules
234
235- ALWAYS name your operations (no anonymous queries/mutations)
236- ALWAYS use variables for dynamic values
237- ALWAYS request only the fields you need
238- ALWAYS include id field for cacheable types
239- NEVER hardcode values in operations
240- NEVER duplicate field selections across files
241- PREFER fragments for reusable field selections
242- PREFER colocating fragments with components
243- USE descriptive operation names that reflect purpose
244- USE @include/@skip for conditional fields
245
In the file
SKILL.md594 words
Files6
LicenceMIT
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈150
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
10,575
on trigger
The instruction body and 5 supporting files, read only when the skill fires.
5.4%
of a 200k window
Ten skills this size would take about 54% of the window before you open a file.
050k100k150k200k context window

10.7k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Heavy. Teams tend to install this one per project rather than globally, and load it only when the job comes up.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It asks the agent to write files, using whatever file access your client already has. It never touches the network.

What it asks for
Writes filesyes
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

6 files, 42.9 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md4.5 kB
  • references/fragments.md7.7 kB
  • references/mutations.md7.8 kB
  • references/queries.md7.8 kB
  • references/tooling.md8.5 kB
  • references/variables.md6.6 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 6 files you can review in full before installing. The MIT licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

$89 once
GraphQL Operations · MIT · apollographql
one-time
Price$89 once
LicenceMIT — the author’s, unchanged by this purchase
Paid throughStripe, once, on the card you add at the checkout
Keeps workingfor good — the files are yours once they are on disk
Updatesevery release of 1.x through this account

You can read the whole bundle before paying — the SKILL.md above is the product, not a preview of it. What the money buys is the delivery: the folder packaged and handed to your machine by key, every update its author ships, and our support if it does not do what this listing says. The terms of use are MIT, set by the author and unchanged by buying it here.

Payment runs through Stripe, on a page like this one rather than a redirect. Once there is an account it joins the same mcprush invoice as everything else you run, so there is never a second card to enter.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Version1.0.0
Publishedno release date on file
Price$89
Referenceapollographql/graphql-operations

Versions

v1.0.0 is what is on the shelf; no release here carries a date. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v1.0.0
  • No earlier releases have been published to the marketplace.
Pinning

Put apollographql/graphql-operations@1.0.0 in the install command to hold this exact version. Without the suffix you get whatever is current the day you install, and nothing moves under you afterwards.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Publisher
Servers0