apollo-federation

tarafından apollographql

Apollo Federation, birden fazla GraphQL API'sini (alt grafikler) birleşik bir süper grafik halinde oluşturmayı sağlar.

npx skills add https://github.com/apollographql/skills --skill apollo-federation

Apollo Federation Schema Authoring

Apollo Federation enables composing multiple GraphQL APIs (subgraphs) into a unified supergraph.

Federation 2 Schema Setup

Every Federation 2 subgraph must opt-in via @link:

extend schema
  @link(url: "https://specs.apollo.dev/federation/v2.12",
        import: ["@key", "@shareable", "@external", "@requires", "@provides"])

Import only the directives your subgraph uses. The version shown (v2.12) is illustrative — check the Federation changelog for currently supported versions before copying it verbatim.

A subgraph's @link version is a floor, not the composition version — see Federation versions for the full explanation.

Core Directives Quick Reference

DirectivePurposeExample
@keyDefine entity with unique keytype Product @key(fields: "id")
@shareableAllow multiple subgraphs to resolve fieldtype Position @shareable { x: Int! }
@externalReference field from another subgraphweight: Int @external
@requiresComputed field depending on external fieldsshippingCost: Int @requires(fields: "weight")
@providesConditionally resolve external field@provides(fields: "name")
@overrideMigrate field to this subgraph@override(from: "Products")
@inaccessibleHide from API schemainternalId: ID! @inaccessible
@interfaceObjectAdd fields to entity interfacetype Media @interfaceObject

Reference Files

Detailed documentation for specific topics:

  • Directives - All federation directives with syntax, examples, and rules
  • Schema Patterns - Multi-subgraph patterns and recipes
  • Composition - Composition rules, error codes, and debugging

Key Patterns

Entity Definition

type Product @key(fields: "id") {
  id: ID!
  name: String!
  price: Int
}

Entity Contributions Across Subgraphs

# Products subgraph
type Product @key(fields: "id") {
  id: ID!
  name: String!
  price: Int
}

# Reviews subgraph
type Product @key(fields: "id") {
  id: ID!
  reviews: [Review!]!
  averageRating: Float
}

Computed Fields with @requires

type Product @key(fields: "id") {
  id: ID!
  size: Int @external
  weight: Int @external
  shippingEstimate: String @requires(fields: "size weight")
}

Value Types with @shareable

type Money @shareable {
  amount: Int!
  currency: String!
}

Entity Stub (Reference Without Contributing)

type Product @key(fields: "id", resolvable: false) {
  id: ID!
}

Ground Rules

  • ALWAYS use Federation 2.x syntax with @link directive
  • ALWAYS import only the directives your subgraph uses
  • NEVER use @shareable without ensuring all subgraphs return identical values for that field
  • PREFER @key with single ID field for simple entity identification
  • USE rover supergraph compose to validate composition locally
  • USE rover subgraph check to validate against production supergraph

apollographql tarafından daha fazla skill

apollo-ios
apollographql
We need to translate the given English text into Turkish, preserving the name "apollo-ios" and technical terms like GraphQL, Swift, async/await, SQLite, HTTP, WebSocket, graphql-transport-ws. The instruction says to translate only the text inside <text>, and not include the name unless it appears in the source text. The name "apollo-ios" does not appear in the source text; the source says "Apollo iOS" (with a space). The instruction says "Name to preserve: apollo-ios" but the source has "Apollo iOS". We should preserve the exact name as given? The instruction says "preserve product names" and the name to preserve is "apollo-ios". However, the source text uses "Apollo iOS". I think we should keep "Apollo iOS" as is because that's the product name in the source. But the instruction says "Name to preserve: apollo-ios" - that might be a key. To be safe, I'll keep "Apollo iOS
apollo-router
apollographql
Apollo Router, Apollo Federation 2 süper grafiklerini çalıştırmak için Rust dilinde yazılmış yüksek performanslı bir grafik yönlendiricisidir. Alt grafiklerinizin önünde yer alır ve sorgu planlaması, yürütme ve yanıt birleştirme işlemlerini yönetir.
apollo-router-plugin-creator
apollographql
Apollo Router için yerel Rust eklentileri oluşturun.
apollo-server
apollographql
Apollo Server 5.x ile çeşitli framework'lerde GraphQL sunucuları oluşturmak için kapsamlı rehber. Şema tanımı, çözücüler, bağlam kurulumu ve TypeScript desteğiyle hata yönetimini kapsar. Prototipleme için bağımsız modu ve Express, Fastify, Koa ile sunucusuz ortamlar için entegrasyonları destekler. Çözücü desenleri, kimlik doğrulama/yetkilendirme, eklentiler, N+1 önleme için DataLoader ve performans optimizasyon tekniklerini içerir. Veri kaynakları, hata... için referans dokümantasyon sağlar.
graphql-operations
apollographql
Verimli, tür güvenli GraphQL işlemleri yazmak ve bunları fragmentlerle organize etmek için en iyi uygulamalar kılavuzu. Sorgular, mutasyonlar, abonelikler ve fragmentleri; adlandırma kuralları, değişken sözdizimi ve yönerge kullanımıyla kapsar. Temel ilkeleri vurgular: yalnızca gerekli alanları isteyin, tüm işlemleri adlandırın, sabit kodlanmış değerler yerine değişkenler kullanın ve önbelleğe alınabilirlik için id alanlarını ekleyin. Fragmentlerin bileşenlerle birlikte konumlandırılmasını ve koşullu alanlar için @include / @skip yönergelerinin kullanılmasını önerir...
graphql-schema
apollographql
Endüstriyel en iyi uygulamalar rehberi; sezgisel, yüksek performanslı ve sürdürülebilir GraphQL şemaları tasarlamak için. İstemci odaklı tip organizasyonu, açık nullability desenleri ve geriye dönük uyumlu evrim stratejileri dahil olmak üzere temel tasarım ilkelerini kapsar. Tipler, adlandırma kuralları, imleç tabanlı sayfalama, hata modelleme ve güvenlik hususları hakkında referans dokümantasyonu sağlar. Kod örnekleriyle arayüzler, birleşimler, girdi tipleri, mutasyonlar ve ID stratejileri için pratik desenler içerir...
rover
apollographql
Apollo Rover CLI, GraphQL şemalarını, federasyonu ve yerel süpergraf geliştirmeyi yönetmek içindir. Alt grafik şemalarını yayımlayın, alın ve doğrulayın; federasyonlu süper grafikleri yerel olarak veya GraphOS aracılığıyla oluşturun. Çalışan sunuculardan şema denetimi (dağıtım öncesi doğrulama), linting ve içe bakış içerir. rover dev komutu, geliştirme iş akışları için otomatik şema oluşturma ile yerel bir Yönlendirici başlatır. Yayımlamadan önce doğrulama ve komut dosyası oluşturma için JSON çıktısı ile CI/CD desenlerini destekler. Gerektirir...
rust-best-practices
apollographql
Apollo GraphQL'in en iyi uygulamalar el kitabına dayalı, doğal Rust kodlama standartları. Dokuz temel alanı kapsar: kodlama stilleri ve deyimler, clippy linting, performans optimizasyonu, hata yönetimi, test desenleri, generics ve dispatch, tip durumu deseni, dokümantasyon ve işaretçi güvenliği. Kopyalama yerine ödünç almayı, thiserror/anyhow ile Result tabanlı hata yönetimini ve release build'lerle performans profillemesini vurgular. Sahiplik desenleri, panic'ten kaçınma konularında hızlı başvuru rehberliği içerir,...