You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/configure-graphql-resolver.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: dlepow
6
6
7
7
ms.service: api-management
8
8
ms.topic: article
9
-
ms.date: 06/08/2023
9
+
ms.date: 05/02/2024
10
10
ms.author: danlep
11
11
---
12
12
@@ -29,6 +29,7 @@ Currently, API Management supports resolvers that can access the following data
29
29
* Each resolver resolves data for a single field. To resolve data for multiple fields, configure a separate resolver for each.
30
30
* 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).
31
31
* 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 support interface and union types in GraphQL resolvers, the backend response must either already contain the `__typename` field, or be altered using the [set-body](set-body-policy.md) policy to include `__typename`.
Copy file name to clipboardExpand all lines: articles/api-management/graphql-apis-overview.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: dlepow
6
6
7
7
ms.service: api-management
8
8
ms.topic: conceptual
9
-
ms.date: 09/18/2023
9
+
ms.date: 05/05/2024
10
10
ms.author: danlep
11
11
---
12
12
@@ -41,12 +41,13 @@ The GraphQL specification explicitly solves common issues experienced by client
41
41
42
42
Using a GraphQL API, the client app can specify the data they need to render a page in a query document that is sent as a single request to a GraphQL service. A client app can also subscribe to data updates pushed from the GraphQL service in real time.
43
43
44
-
## Schema and operation types
44
+
## Schema and types
45
45
46
46
In API Management, add a GraphQL API from a GraphQL schema, either retrieved from a backend GraphQL API endpoint or uploaded by you. A GraphQL schema describes:
47
47
48
48
* Data object types and fields that clients can request from a GraphQL API
49
49
* Operation types allowed on the data, such as queries
50
+
* Other types, such as unions and interfaces, that provide additional flexibility and control over the data
50
51
51
52
For example, a basic GraphQL schema for user data and a query for all users might look like:
52
53
@@ -61,17 +62,23 @@ type User {
61
62
}
62
63
```
63
64
64
-
API Management supports the following operation types in GraphQL schemas. For more information about these operation types, see the [GraphQL specification](https://spec.graphql.org/October2021/#sec-Subscription-Operation-Definitions).
65
+
### Operation types
66
+
67
+
API Management supports the following operation types in GraphQL schemas. For more information about these operation types, see the [GraphQL specification](https://spec.graphql.org/October2021/#sec-Root-Operation-Types).
65
68
66
69
***Query** - Fetches data, similar to a `GET` operation in REST
67
70
***Mutation** - Modifies server-side data, similar to a `PUT` or `PATCH` operation in REST
68
71
***Subscription** - Enables notifying subscribed clients in real time about changes to data on the GraphQL service
69
72
70
73
For example, when data is modified via a GraphQL mutation, subscribed clients could be automatically notified about the change.
71
74
72
-
> [!IMPORTANT]
73
-
> 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.
74
-
>
75
+
> [!IMPORTANT]
76
+
> 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.
77
+
>
78
+
79
+
### Other types
80
+
81
+
API Management supports the [union](https://spec.graphql.org/October2021/#sec-Unions) and [interface](https://spec.graphql.org/October2021/#sec-Interfaces) types in GraphQL schemas.
0 commit comments