graphql-schema

द्वारा apollographql

We need to translate the given English text to Hindi. 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 ignore. No extra labels. Translate only the text inside <text>. Output should be the translated text in Hindi. Let me translate: "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..." I'll translate into natural Hindi, keeping technical terms like GraphQL, cursor-based pagination, etc. as is or with appropriate Hindi transliteration. Ensure no extra commentary. Translation attempt: "सहज, उच्च प्रदर्शन और रखरखाव योग्य GraphQL स्कीम

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

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
  • NEVER expose database internals in schema
  • NEVER break backwards compatibility without deprecation
  • 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)

apollographql की और Skills

apollo-client
apollographql
Apollo Client एक व्यापक स्टेट मैनेजमेंट लाइब्रेरी है जो जावास्क्रिप्ट के लिए है, जो आपको GraphQL के साथ स्थानीय और दूरस्थ डेटा दोनों को प्रबंधित करने में सक्षम बनाती है। संस्करण 4.x बेहतर कैशिंग, बेहतर TypeScript समर्थन, और React 19 अनुकूलता लाता है।
official
apollo-client
apollographql
Apollo Client 4.x के साथ React एप्लिकेशन बनाने के लिए व्यापक गाइड, जिसमें क्वेरी, म्यूटेशन, कैशिंग और स्टेट मैनेजमेंट शामिल हैं। यह कई React फ्रेमवर्क और सेटअप को सपोर्ट करता है: क्लाइंट-साइड ऐप्स (Vite, CRA), React सर्वर कंपोनेंट्स के साथ Next.js App Router, स्ट्रीमिंग SSR के साथ React Router 7, और TanStack Start। इसमें क्वेरी (useQuery, useLazyQuery), म्यूटेशन (useMutation), और आधुनिक React 18+ और 19 के लिए Suspense-आधारित पैटर्न (useSuspenseQuery,
official
apollo-connectors
apollographql
REST APIs को @source और @connect निर्देशों का उपयोग करके GraphQL सुपरग्राफ में एकीकृत करें। एक संरचित 5-चरणीय प्रक्रिया प्रदान करता है: API संरचना पर शोध करें, निर्देशों के साथ स्कीमा लागू करें, rover supergraph compose के माध्यम से मान्य करें, कनेक्टर निष्पादित करें, और परीक्षण कवरेज करें। हेडर, बॉडी पेलोड, N+1 पैटर्न के लिए बैचिंग, और $env के माध्यम से पर्यावरण चर इंजेक्शन सहित अनुरोध कॉन्फ़िगरेशन का समर्थन करता है। फ़ील्ड चयन,
official
apollo-federation
apollographql
Apollo Federation एकाधिक GraphQL API (उपग्राफ) को एक एकीकृत सुपरग्राफ में संयोजित करने में सक्षम बनाता है।
official
apollo-ios
apollographql
Apollo iOS एप्पल प्लेटफॉर्म के लिए एक मजबूत टाइप वाला GraphQL क्लाइंट है। यह आपके GraphQL ऑपरेशन और स्कीमा से Swift प्रकार उत्पन्न करता है, और एक async/await क्लाइंट, एक सामान्यीकृत कैश (इन-मेमोरी या SQLite-समर्थित), एक प्लग करने योग्य इंटरसेप्टर-आधारित HTTP ट्रांसपोर्ट जो क्वेरी, म्यूटेशन और मल्टीपार्ट सब्सक्रिप्शन को संभालता है, और एक वैकल्पिक WebSocket ट्रांसपोर्ट (graphql-transport-ws) जो किसी भी ऑपरेशन
official
apollo-kotlin
apollographql
Apollo Kotlin एक मजबूत टाइप किया गया GraphQL क्लाइंट है जो आपके GraphQL संचालन और स्कीमा से Kotlin मॉडल उत्पन्न करता है, जिसका उपयोग Android, JVM और Kotlin मल्टीप्लेटफ़ॉर्म प्रोजेक्ट्स में किया जा सकता है।
official
apollo-mcp-server
apollographql
एआई एजेंटों को मॉडल कॉन्टेक्स्ट प्रोटोकॉल के माध्यम से GraphQL API से जोड़ता है, जिसमें अंतर्निहित इंट्रोस्पेक्शन और ऑपरेशन टूल्स शामिल हैं। GraphQL ऑपरेशन को MCP टूल के रूप में प्रस्तुत करता है; तीन ऑपरेशन स्रोतों का समर्थन करता है: स्थानीय फ़ाइलें, GraphOS Studio संग्रह, और स्थायी क्वेरी मैनिफेस्ट। स्कीमा अन्वेषण और तदर्थ क्वेरी परीक्षण के लिए चार इंट्रोस्पेक्शन टूल (introspect, search, validate, execute) प्रदान करता है;
official
apollo-router
apollographql
अपोलो राउटर एक उच्च-प्रदर्शन ग्राफ राउटर है जो रस्ट में लिखा गया है और अपोलो फेडरेशन 2 सुपरग्राफ चलाने के लिए है। यह आपके सबग्राफ के सामने बैठता है और क्वेरी योजना, निष्पादन और प्रतिक्रिया संरचना को संभालता है।
official