What the GraphQL API does for you#

Fabric's API for GraphQL auto-generates a schema, resolvers, and a live endpoint from the data sources you connect, so you write and deploy no backend code [S1]. It can sit over a Fabric Data Warehouse, Fabric SQL database, Fabric Lakehouse, Azure SQL Database, or a mirrored database, each reached through its SQL analytics endpoint [S1]. The portal can generate this API directly over a SQL database item too [S2].

Fabric API for GraphQL architecture: connected data sources, auto-generated schema/resolver layer, and the query surface it exposes

Why GraphQL instead of a plain REST call#

A GraphQL query lets a client ask for exactly the fields it needs and follow relationships in one round trip, avoiding two REST problems: over-fetching whole records, and the N+1 pattern of many follow-up requests for related data [S1]. That works because the schema is strongly typed and self-describing — a client or AI agent can introspect it to discover types, fields, and relationships instead of needing a hand-written description [S3].

Setting one up#

Creating a GraphQL item is a portal-driven workflow: create the item, connect sources, choose which tables, views, or stored procedures to expose, optionally model relationships, and set permissions. The endpoint is then immediately queryable, with no separate deployment step [S1]. Fabric also ships an interactive portal editor with a results pane, parameterized query/mutation support, and schema-aware Intellisense for building and testing queries [S1].

A worked example#

Say you connect a GraphQL item to a Lakehouse with Customers and Orders tables and model their one-to-many relationship. A client can now send one query for a customer's name, email, and five most recent order totals — one request, one response, no extra round trips [S1]. Because the schema is introspectable, AI agents can query the same endpoint too, though through a separate Model Context Protocol (MCP) bridge server rather than direct access; MCP is a vendor-neutral standard used well beyond Fabric, including by OpenAI, Copilot Studio, and Microsoft Foundry [S3].

What goes wrong#

  • Treating it like a versioned REST API. Since clients only receive fields they explicitly request, Fabric favors additive schema changes over shipping v1/v2/v3 endpoints — REST-style versioning defeats the point [S1].
  • Assuming the published MCP sample is production-ready. Microsoft's local GraphQL MCP server sample is scoped to development and learning, using HTTP transport and .env-file secrets — not production-ready as published [S3].
  • Forgetting the SQL analytics endpoint underneath. Every supported source is reached through its SQL analytics endpoint, so the GraphQL layer inherits that endpoint's connectivity and permissions rather than being an independent data path [S1].