Skip to content

Commit d1a265b

Browse files
committed
Union and interface types
1 parent a632f6d commit d1a265b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

articles/api-management/configure-graphql-resolver.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: api-management
88
ms.topic: article
9-
ms.date: 06/08/2023
9+
ms.date: 04/24/2024
1010
ms.author: danlep
1111
---
1212

@@ -29,6 +29,7 @@ Currently, API Management supports resolvers that can access the following data
2929
* Each resolver resolves data for a single field. To resolve data for multiple fields, configure a separate resolver for each.
3030
* Resolver-scoped policies are evaluated *after* any `inbound` and `backend` policies in the policy execution pipeline. They don't inherit policies from other scopes. For more information, see [Policies in API Management](api-management-howto-policies.md).
3131
* You can configure API-scoped policies for a GraphQL API, independent of the resolver-scoped policies. For example, add a [validate-graphql-request](validate-graphql-request-policy.md) policy to the `inbound` scope to validate the request before the resolver is invoked. Configure API-scoped policies on the **API policies** tab for the API.
32+
* To use interface and union types in GraphQL resolvers, the backend response must either already contain the `__typename` field, or be altered using the set-body policy to include `__typename`.
3233

3334
## Prerequisites
3435

articles/api-management/graphql-apis-overview.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: api-management
88
ms.topic: conceptual
9-
ms.date: 09/18/2023
9+
ms.date: 04/24/2024
1010
ms.author: danlep
1111
---
1212

@@ -73,6 +73,9 @@ API Management supports the following operation types in GraphQL schemas. For mo
7373
> API Management supports subscriptions implemented using the [graphql-ws](https://github.com/enisdenjo/graphql-ws) WebSocket protocol. Queries and mutations aren't supported over WebSocket.
7474
>
7575
76+
> [!NOTE]
77+
> API Management also supports the [union](https://spec.graphql.org/October2021/#sec-Unions) and [interface](https://spec.graphql.org/October2021/#sec-Interfaces) types in GraphQL schemas.
78+
7679
## Resolvers
7780

7881
*Resolvers* take care of mapping the GraphQL schema to backend data, producing the data for each field in an object type. The data source could be an API, a database, or another service. For example, a resolver function would be responsible for returning data for the `users` query in the preceding example.

0 commit comments

Comments
 (0)