Azure APIM validate-graphql-request policy throws nullpointer exception

Any mention of <validate-graphql-request … /> will cause API to return with the following exception:

 {
     "source": "validate-graphql-request",
     "reason": "GatewayFailure",
     "message": "Object reference not set to an instance of an object.",
     "scope": "api",
     "section": "inbound",
     "path": null,
     "policyId": ""
 }

Stacktrace from insights (not much there):

 GatewayError:
    at validate-graphql-request

Tried the following configuration:

 <inbound>
     <base/>
     <validate-graphql-request error-variable-name="name" max-size="102400" max-depth="4"> 
         <authorize>
             <rule path="/__schema/*" action="reject" /> 
         </authorize>
     </validate-graphql-request>
 </inbound>

or this:

 <validate-graphql-request error-variable-name="name" max-size="102400" max-depth="4">
 </validate-graphql-request>

or this:

 <validate-graphql-request error-variable-name="name" />

or even this:

 <validate-graphql-request />

Read more here: Source link