Tutorial: GraphQL API
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Cephalon.AspNetCore.GraphQL is the GraphQL transport adapter. Each module contributes a subschema; the host federates them into a single endpoint. This tutorial walks through standing up a federated schema, wiring auth, and writing module-owned resolvers.
What you’ll build
Section titled “What you’ll build”- a
Productsmodule that contributestype Productandquery products. - an
Ordersmodule that contributestype Orderandquery orders. - federation that lets clients query both in one request.
- field-level authorisation gated by Cephalon identity capabilities.
Skeleton
Section titled “Skeleton”public sealed class ProductsGraphQlModule : GraphQlBehaviorModuleBase{ public override ModuleDescriptor Describe() => new("Acme.Store.GraphQL.Products", "1.0.0", [Capability.Data]);
protected override void ConfigureGraphQl(IGraphQlBehaviorBuilder builder) { builder.AddType<ProductType>(); builder.AddQueryField("products", resolve: async (catalog, ct) => await catalog.ListAsync(ct)); }}Status
Section titled “Status”Full walkthrough lands in the next docs push. Until then, see:
- Technology → Hosts — the host catalog covers
Cephalon.AspNetCore.GraphQL. - Source → components / aspnetcore-graphql — engine-source-doc mirror with the canonical package surface.
- Reference → Architecture — canonical contracts index (the dedicated Transport surface page is planned for
0.2.0-preview).