graphql-schema

We need to translate the given English text into German. The text is a description of a guide for GraphQL schema design. We must preserve the name "graphql-schema" but it's not in the text, so we don't include it. We must not add any extra commentary, labels, etc. Just translate the text. The text: "Industry best practices guide for designing intuitive, performant, and maintainable GraphQL schemas. Covers core design principles including client-centric type organization, explicit nullability patterns, and backwards-compatible evolution strategies Provides reference documentation on types, naming conventions, cursor-based pagination, error modeling, and security considerations Includes practical patterns for interfaces, unions, input types, mutations, and ID strategies with code examples" Note: There is a missing period after "strategies" and before "Provides". We'll treat it as two sentences. Also "code examples" at the end. Translation to German: "Leitfaden für Branchen-Best Practices zur Gestaltung intuitiver, leistungsfähiger und wartbarer GraphQL-S

npx skills add https://github.com/apollographql/skills --skill graphql-schema

GraphQL Schema Design Guide

This guide covers best practices for designing GraphQL schemas that are intuitive, performant, and maintainable. Schema design is primarily a server-side concern that directly impacts API usability.

Schema Design Principles

1. Design for Client Needs

  • Think about what queries clients will write
  • Organize types around use cases, not database tables
  • Expose capabilities, not implementation details

2. Be Explicit

  • Use clear, descriptive names
  • Make nullability intentional
  • Document with descriptions

3. Design for Evolution

  • Plan for backwards compatibility
  • Use deprecation before removal
  • Avoid breaking changes
  • Give every new argument or input field a default value, or make it nullable. Existing clients don't send it, so a required field without a default makes their requests fail validation.

Quick Reference

Type Definition Syntax

"""
A user in the system.
"""
type User {
  id: ID!
  email: String!
  name: String
  posts(first: Int = 10, after: String): PostConnection!
  createdAt: DateTime!
}

Nullability Rules

PatternMeaning
StringNullable - may be null
String!Non-null - always has value
[String]Nullable list, nullable items
[String!]Nullable list, non-null items
[String]!Non-null list, nullable items
[String!]!Non-null list, non-null items

Best Practice: Use [Type!]! for lists - empty list over null, no null items.

Input vs Output Types

# Output type - what clients receive
type User {
  id: ID!
  email: String!
  createdAt: DateTime!
}

# Input type - what clients send
input CreateUserInput {
  email: String!
  name: String
}

# Mutation using input type
type Mutation {
  createUser(input: CreateUserInput!): User!
}

Interface Pattern

interface Node {
  id: ID!
}

type User implements Node {
  id: ID!
  email: String!
}

type Post implements Node {
  id: ID!
  title: String!
}

Union Pattern

union SearchResult = User | Post | Comment

type Query {
  search(query: String!): [SearchResult!]!
}

Reference Files

Detailed documentation for specific topics:

  • Types - Type design patterns, interfaces, unions, and custom scalars
  • Naming - Naming conventions for types, fields, and arguments
  • Pagination - Connection pattern and cursor-based pagination
  • Errors - Error modeling and result types
  • Security - Security best practices for schema design

Key Rules

Type Design

  • Define types based on domain concepts, not data storage
  • Use interfaces for shared fields across types
  • Use unions for mutually exclusive types
  • Keep types focused (single responsibility)
  • Avoid deep nesting - flatten when possible

Field Design

  • Fields should be named from client's perspective
  • Return the most specific type possible
  • Make expensive fields explicit (consider arguments)
  • Use arguments for filtering, sorting, pagination

Mutation Design

  • Use single input argument pattern: mutation(input: InputType!)
  • Return affected objects in mutation responses
  • Model mutations around business operations, not CRUD
  • Consider returning a union of success/error types

ID Strategy

  • Use globally unique IDs when possible
  • Implement Node interface for refetchability
  • Base64-encode compound IDs if needed

Ground Rules

  • ALWAYS add descriptions to types and fields
  • ALWAYS use non-null (!) for fields that cannot be null
  • ALWAYS use [Type!]! pattern for lists
  • ALWAYS paginate lists that can grow without limit, such as Query.users or Post.comments: return a connection and give first a default page size
  • NEVER expose database internals in schema
  • NEVER break backwards compatibility without deprecation
  • NEVER add a required argument or input field without a default value
  • PREFER dedicated input types over many arguments
  • PREFER enums over arbitrary strings for fixed values
  • USE ID type for identifiers, not String or Int
  • USE custom scalars for domain-specific values (DateTime, Email, URL)

Mehr Skills von apollographql

apollo-federation
apollographql
Apollo Federation ermöglicht das Zusammenführen mehrerer GraphQL-APIs (Subgraphen) zu einem einheitlichen Supergraphen.
apollo-ios
apollographql
Apollo iOS ist ein stark typisierter GraphQL-Client für Apple-Plattformen. Er generiert Swift-Typen aus Ihren GraphQL-Operationen und Ihrem Schema und enthält einen Async/Await-Client, einen normalisierten Cache (im Arbeitsspeicher oder SQLite-gestützt), einen steckbaren, auf Interceptoren basierenden HTTP-Transport, der Abfragen, Mutationen und Multipart-Abonnements verarbeitet, sowie einen optionalen WebSocket-Transport (graphql-transport-ws), der jeden Operationstyp übertragen kann.
apollo-router
apollographql
Apollo Router ist ein leistungsstarker Graph-Router, der in Rust geschrieben wurde und für den Betrieb von Apollo Federation 2-Supergraphen entwickelt wurde. Er sitzt vor Ihren Subgraphen und übernimmt die Abfrageplanung, -ausführung und Antwortkomposition.
apollo-router-plugin-creator
apollographql
Erstelle native Rust-Plugins für Apollo Router.
apollo-server
apollographql
Vollständiger Leitfaden zum Erstellen von GraphQL-Servern mit Apollo Server 5.x in verschiedenen Frameworks. Behandelt Schema-Definition, Resolver, Kontext-Einrichtung und Fehlerbehandlung mit TypeScript-Unterstützung. Unterstützt Standalone-Modus für Prototyping sowie Integrationen mit Express, Fastify, Koa und serverlosen Umgebungen. Enthält Resolver-Muster, Authentifizierung/Autorisierung, Plugins, DataLoader zur N+1-Vermeidung und Techniken zur Leistungsoptimierung. Bietet Referenzdokumentation für Datenquellen, Fehler...
graphql-operations
apollographql
Leitfaden für Best Practices zum Schreiben effizienter, typsicherer GraphQL-Operationen und deren Organisation mit Fragmenten. Behandelt Queries, Mutationen, Subscriptions und Fragmente mit Namenskonventionen, Variablensyntax und Direktivenverwendung. Betont Kernprinzipien: nur benötigte Felder anfordern, alle Operationen benennen, Variablen statt hartcodierter Werte verwenden und ID-Felder für die Cache-Fähigkeit einfügen. Empfiehlt, Fragmente mit Komponenten zu kollokieren und @include-/@skip-Direktiven für bedingte Felder zu nutzen...
rover
apollographql
We need to translate the given English text into German, preserving the name "rover" and any technical terms. The text describes the Apollo Rover CLI. We must not add any extra commentary or labels. The translation should be accurate and natural in German. Let's break down the text: "Apollo Rover CLI for managing GraphQL schemas, federation, and local supergraph development. Publish, fetch, and validate subgraph schemas; compose federated supergraphs locally or via GraphOS Includes schema checking (pre-deploy validation), linting, and introspection from running servers rover dev command starts a local Router with automatic schema composition for development workflows Supports CI/CD patterns with check-before-publish validation and JSON output for scripting Requires..." We need to translate this into German. Keep "rover" as is. Also "GraphQL", "federation", "supergraph", "subgraph", "GraphOS", "Router", "CI/CD", "JSON" are technical terms that should remain in English or be commonly used in German tech contexts. Usually, these are kept as is
rust-best-practices
apollographql
We need to translate the given English text into German, preserving the name "rust-best-practices" if it appears. The text is a description of an agent skill. The instruction says: "Do not include the name unless it appears in the source text." The name "rust-best-practices" does not appear in the provided <text> block. So we should not add it. Also, preserve product names, protocol names, URLs, numbers, technical terms. So "Apollo GraphQL", "clippy", "thiserror", "anyhow", "Result", etc. should remain as is or translated? Technical terms like "clippy linting" might be kept as "Clippy-Linting" or similar. But the instruction says "preserve product names, protocol names, URLs, numbers, and technical terms." So we keep them in original form. However, we are translating to German, so we need to produce a natural German translation. For example, "Idiomatic Rust coding standards" -> "Idiomatische Rust-Codierungsstand