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
+28-5Lines changed: 28 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Currently, API Management supports resolvers that can access the following data
25
25
* A resolver is a resource containing a policy definition that's invoked only when a matching object type and field in the schema is executed.
26
26
* Each resolver resolves data for a single field. To resolve data for multiple fields, configure a separate resolver for each.
27
27
* 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).
28
-
28
+
* 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.
29
29
30
30
> [!IMPORTANT]
31
31
> * If you use the preview `set-graphql-resolver` policy in policy definitions, you should migrate to the managed resolvers described in this article.
@@ -59,13 +59,36 @@ The following steps create a resolver using an HTTP-based data source. The gener
59
59
60
60
:::image type="content" source="media/configure-graphql-resolver/configure-resolver-policy.png" alt-text="Screenshot of resolver policy editor in the portal." lightbox="media/configure-graphql-resolver/configure-resolver-policy.png":::
61
61
62
-
1. The resolver is attached to the field. Go to the **Resolvers** tab to list and manage the resolvers configured for the API. You can also create resolvers from the **Resolvers** tab.
62
+
The resolver is attached to the field and appears on the **Resolvers** tab.
63
+
63
64
64
65
:::image type="content" source="media/configure-graphql-resolver/list-resolvers.png" alt-text="Screenshot of the resolvers list for GraphQL API in the portal." lightbox="media/configure-graphql-resolver/list-resolvers.png":::
65
66
66
-
> [!TIP]
67
-
> * The **Linked** column indicates whether the resolver is configured for a field that's currently in the GraphQL schema. If a resolver isn't linked, it can't be invoked.
68
-
> * You can clone a listed resolver to quickly create a similar resolver that targets a different type and field. In the context menu (**...**), select **Clone**.
67
+
## Manage resolvers
68
+
69
+
List and manage the resolvers for a GraphQL API on the API's **Resolvers** tab.
70
+
71
+
:::image type="content" source="media/configure-graphql-resolver/resolvers-tab.png" alt-text="Screenshot of managing resolvers for GraphQL API in the portal." lightbox="media/configure-graphql-resolver/resolvers-tab.png":::
72
+
73
+
On the **Resolvers** tab:
74
+
75
+
* The **Linked** column indicates whether the resolver is configured for a field that's currently in the GraphQL schema. If a resolver isn't linked, it can't be invoked.
76
+
77
+
* In the context menu (**...**) for a resolver, find commands to **Clone**, **Edit**, or **Delete** a resolver. Clone a listed resolver to quickly create a similar resolver that targets a different type and field.
78
+
79
+
* You can create a new resolver by selecting **+ Create**.
80
+
81
+
## Edit and test a resolver
82
+
83
+
When you edit a single resolver, the **Edit resolver** page opens. You can:
84
+
85
+
* Update the resolver policy and optionally the data source. Changing the data source overwrites the current resolver policy.
86
+
87
+
* Change the type and field that the resolver targets.
88
+
89
+
* Test and debug the resolver's configuration. As you edit the resolver policy, select **Run Test** to check the output from the data source, which you can validate against the schema. If errors occur, the response includes troubleshooting information.
90
+
91
+
:::image type="content" source="media/configure-graphql-resolver/edit-resolver.png" alt-text="Screenshot of editing a resolver in the portal." lightbox="media/configure-graphql-resolver/edit-resolver.png":::
Copy file name to clipboardExpand all lines: articles/api-management/graphql-schema-resolve-api.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,9 @@ type User {
107
107
1. Select **Create**.
108
108
1. To resolve data for another field in the schema, repeat the preceding steps to create a resolver.
109
109
110
+
> [!TIP]
111
+
> As you edit a resolver policy, select **Run Test** to check the output from the data source, which you can validate against the schema. If errors occur, the response includes troubleshooting information.
0 commit comments