What are the Policies available for GraphQL API in Azure API management?

Arpan Banerjee 5 Reputation points
2024-04-24T10:41:21.13+00:00

I've been delving into policies for my GraphQL API within Azure API Management (APIM), and I've noticed that certain policies such as mocking and caching appear to be disabled. This has left me wondering whether these policies are not supported for GraphQL APIs within Azure APIM. Could someone kindly provide clarification on this matter?

I've attached a screenshot for reference.

Additionally, I'd greatly appreciate guidance on where I can find relevant documentation detailing the supported policies specifically tailored for GraphQL APIs within Azure APIM.

Thank you in advance for any assistance or insights you can provide!

User's image

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,769 questions
{count} vote

2 answers

Sort by: Most helpful
  1. soms 0 Reputation points
    2024-04-24T10:58:25.8966667+00:00

    Enablement/Disablement of Built-in API Policies depend Managed gateway pricing tier (Classic, v2, Consumption) and self-hosted gateway. Managed and self-hosted gateway.

    The detailed documentation of every built-in API policies is here.User's image


  2. JananiRamesh-MSFT 21,471 Reputation points
    2024-04-29T06:46:49.15+00:00

    @Arpan Banerjee Thanks for reaching out. Below are the GraphQL Unsupported policies.

    validate-content, validate-parameters, validate-headers, validate-status-code (GraphQL has a separate request validation policy validate-graphql-request)

    send-one-way-request | Doesn't make sense for GraphQL APIs.

    set-method | GraphQL APIs allow only POST (and GET, if supported)

    cache-lookup, cache-store, cache-store-value, cache-remove-value, cache-lookup-value (GraphQL caching will have a separate policy)

    json-to-xml, xml-to-json, xml-transform | XML is not supported in GraphQL APIs

    publish-to-dapr, invoke-dapr-binding | Doesn't make sense for GraphQL APIs

    https://learn.microsoft.com/en-us/azure/api-management/validate-graphql-request-policy

    https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-policies#graphql-resolver-policies

    User's image

    do let me know incase of further queries, I would be happy to assist you.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments