Skip to content

Commit e5ba283

Browse files
authored
Update graphql-validation-policies.md
Correct path example and description
1 parent 4a0677a commit e5ba283

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/api-management/graphql-validation-policies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The policy for path=`/__*` is the [introspection](https://graphql.org/learn/intr
5353
```xml
5454
<validate-graphql-request error-variable-name="variable name" max-size="size in bytes" max-depth="query depth">
5555
<authorize>
56-
<rule path="query path, for example: '/Query/listUsers' or '/__*'" action="string or policy expression that evaluates to 'allow|remove|reject|ignore'" />
56+
<rule path="query path, for example: '/listUsers' or '/__*'" action="string or policy expression that evaluates to 'allow|remove|reject|ignore'" />
5757
</authorize>
5858
</validate-graphql-request>
5959
```
@@ -63,13 +63,13 @@ The policy for path=`/__*` is the [introspection](https://graphql.org/learn/intr
6363
This example applies the following validation and authorization rules to a GraphQL query:
6464
* Requests larger than 100 kb or with query depth greater than 4 are rejected.
6565
* Requests to the introspection system are rejected.
66-
* The `/ship/missions/name` field is removed from requests containing more than two headers.
66+
* The `/Missions/name` field is removed from requests containing more than two headers.
6767

6868
```xml
6969
<validate-graphql-request error-variable-name="name" max-size="102400" max-depth="4">
7070
<authorize>
7171
<rule path="/__*" action="reject" />
72-
<rule path="Query/ship/missions/name" action="@(context.Request.Headers.Count > 2 ? "remove" : "allow")" />
72+
<rule path="/Missions/name" action="@(context.Request.Headers.Count > 2 ? "remove" : "allow")" />
7373
</authorize>
7474
</validate-graphql-request>
7575
```
@@ -103,7 +103,7 @@ This example applies the following validation and authorization rules to a Graph
103103
| `error-variable-name` | Name of the variable in `context.Variables` to log validation errors to. | No | N/A |
104104
| `max-size` | Maximum size of the request payload in bytes. Maximum allowed value: 102,400 bytes (100 KB). (Contact [support](https://azure.microsoft.com/support/options/) if you need to increase this limit.) | Yes | N/A |
105105
| `max-depth` | An integer. Maximum query depth. | No | 6 |
106-
| `path` | Path to execute authorization validation on. | Yes | N/A |
106+
| `path` | Path to execute authorization validation on. It must follow the pattern: `/type/field`. | Yes | N/A |
107107
| `action` | [Action](#request-actions) to perform if the rule applies. May be specified conditionally using a policy expression. | No | allow |
108108

109109
### Request actions

0 commit comments

Comments
 (0)