Azure APIM validate-graphql-request policy throws nullpointer exception

Andre Haverdings 6 Reputation points
2022-09-26T06:09:52.28+00:00

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 />  
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,740 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 20,916 Reputation points
    2022-09-26T12:04:49.91+00:00

    Hi @Andre Haverdings Thanks for reaching out. I tried inhouse but I am unable to reproduce the error. Could you please let me know if this issue started suddenly? Is it was working fine before?

    247297-image.png

    247321-image.png