back
loading skill details...
>
Best practices guide for writing efficient, type-safe GraphQL operations and organizing them with fragments.
Covers queries, mutations, subscriptions, and fragments with naming conventions, variable syntax, and directive usage
Emphasizes core principles: request only needed fields, name all operations, use variables instead of hardcoded values, and include id fields for cacheability
Recommends colocating fragments with components and using @include/@skip directives for conditional field selection
Compatible with any GraphQL client (Apollo Client, urql, Relay) and includes reference documentation for queries, mutations, fragments, variables, and tooling
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.
Operation Basics
Query Structure
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
}
}
Mutation Structuredon't have the plugin yet? install it then click "run inline in claude" again.