Azure APIM GraphQL Union

Romain Pfund 0 Reputation points


I've found in the March release note (

and the documentation (

That we can start using GraphQL Union in APIM.

Based on the example, I've done a simple test GraphQL API but it doesnt't seems to work:

Here's my simple GraphQL Schema:

type Query {
  customerById(id: ID): Customer

union Customer = RegisteredCustomer | GuestCustomer

type RegisteredCustomer {
  customerId: Int!
  firstName: String
  lastName: String
  isActive: Boolean

type GuestCustomer {
  firstName: String
  lastName: String!

A simple resolver on the query, where I force the body response (when I test it I get the expected response, with the __typename from the doc)

But when I test it, I have an INVALID_OPERATION

  "errors": [
      "message": "Error trying to resolve field 'customerById'.",
      "locations": [
          "line": 2,
          "column": 2
      "path": [
      "extensions": {
        "code": "INVALID_OPERATION",
        "codes": [
  "data": {
    "customerById": null

Am I doing something wrong or the Union is not available yet ?

Best regards


Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,792 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Romain Pfund 0 Reputation points

    Just needed to wait. Our APIM is now up to date and the Union example works.

    The May release Note announce the support on Interface, hope it will be available quickly.

    This thread can be considered close

    0 comments No comments