Hasura and Microsoft Data API builder both generate a GraphQL surface over selected SQL Server data. Hasura starts with tracked objects, metadata and role rules. Data API builder starts with a configuration file that names the database objects, exposed operations and permissions. That difference matters when teams need to review and deploy changes to the contract.

A GraphQL endpoint can serve related records in one request and still put heavy work on the database. Paging, filters, authorization and the SQL generated by real client queries matter more than the number of fields in the demo. The shortlist includes application frameworks for teams that need to own those choices in resolver code, plus a gateway for teams that already have a GraphQL service.

Hasura vs Data API Builder for SQL Server GraphQL at a glance

Compare generated APIs and code-first services by where relationships and authorization are defined. Test every nested source under the same actual role.

Eight ways to deliver SQL Server GraphQL
ToolGraphQL pathRelationship and access controlTrial evidence
Hasura GraphQL Engine v2Generated GraphQL for documented SQL Server sourceHasura metadata, role and source-specific feature supportExpected nested rows with verified role
Microsoft Data API builderGraphQL generated from configured SQL entitiesEntity relationships, roles and policiesExpected nesting and explicit permissions
DirectusGraphQL over configured collectionsCollection, relationship and role permissionsActual scoped records
Hot Chocolate with EF CoreCode-first .NET GraphQL and SQL data accessResolvers, filters and server-side access logicResult and observed SQL operation count
Apollo Server with Prisma ORM 7Code-first resolvers backed by compatible SQL Server adapterApp identity, resolver logic and data filteringCorrect nested records from intended client
Strawberry GraphQL with SQLAlchemyPython GraphQL schema and database accessApplication permissions and relationship queriesScoped response and correct loading behavior
Spring for GraphQL with Microsoft JDBCJava GraphQL service and SQL access layerResolver authorization and SQL query policyExpected nested output and tested error behavior
IBM API Connect for GraphQLSupported GraphQL schema and SQL source integrationConnector version, schema and policyExpected scoped results and managed deployment

Hasura GraphQL Engine v2

Hasura GraphQL Engine v2 generates a graph from tracked SQL Server objects. Metadata describes relationships and role permissions, including row and column restrictions for supported operations. Clients can request related records through the graph without the application defining a resolver for every relationship.

It fits a team that already deploys Hasura metadata or needs declarative relationships and per-role access rules over an existing database. The supported operations vary across database backends. SQL Server's documented queries, mutations and subscriptions determine which parts of a planned graph can be generated.

Use the v2 feature matrix for the SQL Server connector and the installed Hasura version. Configure and review table metadata and the roles allowed to query the nested fixture.

Verify both parent and child fields with the real role. Attempt the lab query for a conflicting tenant and check that a same-number order in another tenant is excluded.

Hasura’s v2 Console shows how to track relationships in a sample database
Hasura’s v2 Console shows how to track relationships in a sample database. Publisher screenshot
Compatibility
Hasura v2 with Microsoft SQL Server feature support as documented for the deployment.
License and trial
Open-source engine with commercial Hasura editions and services.

Microsoft Data API builder

Microsoft Data API builder exposes a GraphQL schema for named SQL Server entities in a configuration file. A table or view can become a typed entity, and permissions describe which roles can perform the actions supported for that object. REST endpoints can share the same entity configuration.

It suits a Microsoft-oriented team that wants configuration alongside the deployment and a small API over existing database objects. Entity rules govern exposure while SQL Server sees the configured database connection. A client contract with calculated fields or cross-service business logic can require code outside the generated graph.

Register the SQL entities and their documented relationships and policies. Check field access, filters and relationship columns under the intended API role.

Use the generated schema to query the nested order and compare to the SQL baseline. Test the same role against the child entity directly when it is exposed.

Microsoft’s Data API builder entity settings in VS Code show the custom GraphQL type field
Microsoft’s Data API builder entity settings in VS Code show the custom GraphQL type field. Publisher screenshot
Compatibility
Supported SQL Server and Azure SQL sources using configured GraphQL entities.
License and trial
Open-source Microsoft project with a self-hosted runtime.

Directus

Directus presents a GraphQL API over its collections and relationships. Its data model and permissions also support the platform's REST API and admin interface. On a supported SQL Server project, callers see the parts of that model available to their role.

It fits a project that needs one place for content editing and programmatic reads. The shared model means a change made for an editor can affect the GraphQL contract as well. The project also needs room for Directus system tables and a tested mapping for the existing SQL Server schema.

Verify the documented SQL Server compatibility and selected Directus GraphQL collection settings. Record the key map and permissions for both collections.

Run the scoped query and check the generated shape. Verify the intended column and row access from a direct child query as well as through the parent.

Directus Studio illustrates a field-level permission in an example policy
Directus Studio illustrates a field-level permission in an example policy. Publisher screenshot
Compatibility
Directus using its supported MSSQL database client and schema conventions.
License and trial
Source-available license with commercial terms for qualifying use.

Hot Chocolate with EF Core

Hot Chocolate gives a .NET application control over its GraphQL schema and resolvers. Fetching tools can apply paging, filtering and projection over a compatible queryable source. EF Core supplies SQL Server translation and data access for a project that exposes results from its model.

It fits a team that needs domain resolvers, authorization and generated queries in the same .NET service. A resolver can also create expensive database work when fields or relationships fan out. Projection support, batching and DbContext lifetime need to match the way the service resolves nested fields.

Use the supported Hot Chocolate and EF Core data access behavior and decide how the resolver applies authorized tenant filtering. Record whether the chosen path uses projections or batching.

Compare the nested result and observe generated SQL count for larger pages. Check authorization and actual data returned with both principal scopes.

ChilliCream’s Nitro IDE shows the GraphQL schema explorer. This is a client view for inspecting a GraphQL schema
ChilliCream’s Nitro IDE shows the GraphQL schema explorer. This is a client view for inspecting a GraphQL schema. Publisher screenshot
Compatibility
Hot Chocolate with compatible .NET and EF Core SQL Server provider versions.
License and trial
Open-source GraphQL server, with any commercial ChilliCream services licensed separately.

Apollo Server with Prisma ORM 7

Apollo Server runs a GraphQL service with schema and resolvers defined in JavaScript or TypeScript. Prisma ORM 7 can be the data layer for a SQL Server resolver through its Microsoft SQL Server adapter. The database model and GraphQL contract remain separate parts of the application.

It works well for Node teams with a public API that needs to survive changes to physical tables. Resolver code owns access policy, paging and handling of relational fan-out. Prisma's SQL Server provider and adapter capabilities determine which mappings and database behavior can sit behind that contract.

Choose a compatible Prisma SQL Server integration and write the resolvers using authorized identity. Document how joins or batching return the intended tenant data.

Inspect nested line results and capture the number of database operations for more than one order. Verify that client-supplied fields cannot broaden permitted data.

Apollo Sandbox shows a GraphQL document and its input variables
Apollo Sandbox shows a GraphQL document and its input variables. Publisher screenshot
Compatibility
Apollo Server for Node.js with Prisma ORM 7 and its supported SQL Server versions.
License and trial
Open-source packages with optional commercial Apollo and Prisma services.

Strawberry GraphQL with SQLAlchemy

Strawberry defines a GraphQL schema through Python types and resolver functions. SQLAlchemy can execute SQL Server queries through its MSSQL dialect and a suitable DBAPI driver. The application decides what data each field returns and how requests use database sessions.

This fits Python services that need to combine SQL Server records with rules already implemented in application code. Relationships that trigger one query per result can become costly quickly. Batching, request context and the interaction between synchronous drivers and async resolvers are responsibilities of the service.

Use the supported Strawberry schema and SQLAlchemy SQL Server driver. Plan the resolver and SQL scopes independently and keep the relation keys explicit.

Test the nested query and direct lookup under the real role. Verify actual DB calls or batching and keep expected errors with the authorization test.

Strawberry’s quickstart shows GraphiQL with the fields and response from a sample query
Strawberry’s quickstart shows GraphiQL with the fields and response from a sample query. Publisher screenshot
Compatibility
Strawberry and SQLAlchemy with a supported SQL Server DBAPI driver.
License and trial
Open-source libraries with separate hosting and database costs.

Spring for GraphQL with Microsoft JDBC

Spring for GraphQL maps schema operations to controllers and data fetchers in a Java application. SQL Server can sit behind the service through JDBC with Microsoft's driver. Existing Spring authorization, transaction and connection-pool configuration can remain part of the application.

It fits a Java estate with domain services that should remain responsible for writes and access decisions. The schema and resolver code still need to express which related data can be loaded together. Batching and query limits matter when a UI can request nested objects over a large result set.

Connect the documented GraphQL service to the approved SQL Server JDBC path. Decide which query layer handles verified requester identity and allowed relationship keys.

Review actual results and SQL execution for the pilot. Test separately how invalid nested fields and unauthorized rows are represented in the GraphQL response.

Spring’s tutorial shows a nested books-and-authors response in GraphiQL
Spring’s tutorial shows a nested books-and-authors response in GraphiQL. Publisher screenshot
Compatibility
Supported Spring for GraphQL and Microsoft JDBC Driver for SQL Server releases.
License and trial
Open-source framework and driver with separate deployment costs.

IBM API Connect for GraphQL

IBM API Connect can manage a GraphQL service through a gateway. It adds API management controls around the upstream schema and endpoint, while that upstream service remains responsible for the resolvers, transactions and SQL Server connection.

It belongs on a shortlist when a working graph needs managed client access, policy and operational controls. During a greenfield SQL Server project, the database-facing graph must still be implemented and deployed. The gateway's supported policies and the backend's permissions both affect the final result.

Verify the supported IBM GraphQL service release and SQL Server integration, schema and policy configuration. Confirm the actual route and permitted child objects.

Run the fixture under the intended consumer identity and validate the lines and source. Keep operational results and supported deployment details with the article's pilot.

IBM’s StepZen Explorer example shows a GraphQL query and response
IBM’s StepZen Explorer example shows a GraphQL query and response. Publisher screenshot
Compatibility
Supported IBM API Connect Gateway backed by an existing GraphQL service.
License and trial
Commercial IBM licensing and supported gateway edition requirements.

Hasura and Microsoft Data API builder compared

FeatureHasura GraphQL Engine v2Microsoft Data API builder
Define the schemaConnect SQL Server and track tables, views and relationships as Hasura metadata. Inspect which queries each role receives.Declare SQL entities with GraphQL enabled. Check the generated schema, keys, and any names you configure for the API.
Map projects to tasksTrack an array relationship using the SQL Server metadata. Verify the project and task join fields and their role permissions.Configure a one-to-many relationship in the same configuration. Microsoft documents one-hop navigation, so test the shape you intend to expose.
Scope rows and fieldsSet select permissions and allowed columns per role and table. Bind the account filter to a trusted session variable.Use role permissions, field lists and a database policy using an authenticated claim, or apply SQL Server-side scope. Check the role in the real request.
Page a nested listUse limit and offset for the first trial. Hasura also documents keyset pagination using where with the sort columns.Use first and the endCursor from the child connection for the next after request. Check the same filters and sorting on both pages.
Test discovery and write accessRequest the schema and try a mutation as the ordinary reader. Check which operations and fields the reader can use.Only configure the read action for the reader. Test the generated schema and a mutation attempt with the same token.
Deploy and maintainVersion SQL changes and the Hasura metadata. Check the SQL Server matrix for your v2 release and verify DDN separately if you are evaluating it.Version the Data API builder configuration and test the generated schema after database or config changes. Price hosting, authentication and operations.

Which GraphQL option fits the application?

What you needTools to shortlistWhat to verify
Generate a GraphQL schema over SQL Server objectsTest the generated relationship and run the same permission checks on the parent and child.
Author GraphQL resolvers in an applicationReview where permissions are enforced, how child rows are loaded, and who maintains the API.
Compose SQL Server and other sources in a graphVerify the connector and how the consumer’s identity scopes the published fields.

Check how GraphQL relationships and permissions map to SQL

Hasura v2 and Data API Builder can expose documented SQL Server entities through GraphQL. Verify the source feature matrix and generated schema before assuming the selected version supports every relationship or operation. Code-first tools move these decisions into application logic.

Check keys and row permissions for both entities. An allowed parent can still have an incorrectly scoped nested child if the relationship or child access policy is incomplete. Verify the actual response and observe query volume for the expected workload.

What does the GraphQL service need most?
  • Generated SQL Server schema with configured permissions

    Trial Hasura v2 and Data API Builder on the actual source

    Verify entity configuration, relationship key mapping and role coverage.

  • Application-specific resolver logic

    Compare code-first GraphQL services

    Implement and validate identity, SQL filters and batching explicitly.

  • Nested results across tenant-scoped tables

    Test parent and child scopes separately

    Check correct nesting and direct exposure of an independently queryable child.

Verify a tenant-scoped GraphQL query with a shared order number

Use tenant 7 and tenant 8, each with order 11. Tenant 7 has two visible lines totaling 25. The other tenant has a line worth 99. Use the composite tenant and order key for the relationship. The query under tenant 7 should return only its two lines.

Run the same approved operation from both products using their generated GraphQL names. Also test direct child access when the API exposes it. Compare returned rows and actual DB calls under a representative multi-order query.

Nested GraphQL acceptance checks
TestExpectedEvidence
Tenant 7 order 11Two lines totaling 25Parent query and scoped child rows
Other tenant's lineExcluded from tenant 7Result reflects composite key and row access
Direct child lookupOnly permitted rows when exposedUnderlying role policy holds independently
Representative nested queryCorrect data and observed database workResolver or backend query count

How to compare these tools

Load the same parent and child rows in both products. Verify that permission filters apply to nested results, later pages and lookups by ID. Sources checked .

Query related tasks as two accounts

Use the reference query in the disposable GraphQlScopeTrial database. Prepare equivalent order and line tables in the actual test API datasource. Configure the composite relationship and approved authorization rules in each candidate before comparing results.

SQL

Verify the SQL Server baseline for a nested tenant-scoped query

T-SQL · 18 lines

SET NOCOUNT ON;IF DB_NAME() <> N'GraphQlScopeTrial'    THROW 51000, 'Use the disposable GraphQlScopeTrial database.', 1; DECLARE @AuthorizedTenantId int = 7, @OrderId int = 11;WITH Orders AS (    SELECT TenantId, OrderId FROM (VALUES (7,11),(8,11)) AS o(TenantId,OrderId)),Lines AS (    SELECT TenantId, OrderId, LineId, Amount    FROM (VALUES (7,11,1,10),(7,11,2,15),(8,11,1,99))        AS l(TenantId,OrderId,LineId,Amount))SELECT o.OrderId, l.LineId, l.Amount, SUM(l.Amount) OVER () AS ScopedTotalFROM Orders AS oJOIN Lines AS l ON l.TenantId = o.TenantId AND l.OrderId = o.OrderIdWHERE o.TenantId = @AuthorizedTenantId AND o.OrderId = @OrderIdORDER BY l.LineId;
Review before runningT-SQLUTF-818 lines
  1. Register equivalent SQL tables, roles and composite relationship in both tools. Check the actual generated schema before issuing the nested fixture query.
  2. Confirm the authorized parent and two expected children, then test a conflicting tenant and direct child access. Compare the output with the independent SQL result.
  3. Measure a representative nested query and record the database operations and actual API latency. Keep evidence of unsupported features or client-visible errors.

Conclusion

Choose based on the GraphQL response your client needs and how your team wants to manage permissions. Compare the generated schema and the deployed API using real client identities. Price the work to keep both aligned with SQL Server changes.

Frequently asked questions

Should I use Hasura or Microsoft Data API Builder for SQL Server GraphQL?

Use Hasura v2 if you prefer tracking SQL Server objects and maintaining Hasura metadata and permission rules. Use Data API builder if a configuration file over selected SQL entities fits your deployment. Test the nested shape, role scope and continuation before you choose.

Does Hasura support related SQL Server tables in GraphQL?

Hasura’s v2 feature matrix lists table relationships and nested object queries for SQL Server. DDN uses connector-specific capabilities, so check the matrix for the connector and version you plan to deploy.

How does Microsoft Data API builder page nested queries?

Use the configured relationship and the child collection’s first and after arguments. Request hasNextPage and endCursor, then use the returned cursor with the same filters and order for the next request.

How do I verify GraphQL account and field permissions?

Use two ordinary client identities, test nested and direct lookups, and request a field the role cannot read. Inspect response data and errors. Repeat with an invalid or missing identity and try an action the role cannot perform.

Does a GraphQL server need a native SQL Server connector?

Tools such as Hasura and Data API builder provide SQL Server connectivity. Frameworks such as Hot Chocolate, Apollo Server, Strawberry and Spring for GraphQL use resolvers or data fetchers and a SQL Server-capable database library.

Why check SQL relationship keys in a GraphQL API?

The nested field depends on the relation mapping. An incomplete join key can return rows from a different tenant or parent. Verify actual child rows and permissions.

Do Hasura and Data API Builder expose an identical GraphQL schema for SQL Server?

Check generated names, relationship shapes and supported options for each deployed product. Compare equivalent operations and verify the permissions and result under the intended role.

Related guides

Guide~12 min readUpdated 16 Nov 2026
LinkedInXEmail