ExShopifySchema.Generator.Graphql.Introspection.Definition.UnionType (ExShopifySchema v2025.4.2)

View Source

GraphQL Unions represent an object that could be one of a list of GraphQL Object types, but provides for no guaranteed fields between those types.

https://spec.graphql.org/October2021/#sec-Unions

Example introspection payload

{
  "kind": "UNION",
  "name": "PricingValue",
  "description": "The type of value given to a customer when a discount is applied to an order. For example, the application of the discount might give the customer a percentage off a specified item. Alternatively, the application of the discount might give the customer a monetary value in a given currency off an order.",
  "fields": null,
  "inputFields": null,
  "interfaces": null,
  "enumValues": null,
  "possibleTypes": [
    {
      "kind": "OBJECT",
      "name": "MoneyV2",
      "ofType": null
    },
    {
      "kind": "OBJECT",
      "name": "PricingPercentageValue",
      "ofType": null
    }
  ]
}

Summary

Types

t()

@type t() :: %ExShopifySchema.Generator.Graphql.Introspection.Definition.UnionType{
  description: String.t() | nil,
  directives: [
    ExShopifySchema.Generator.Graphql.Introspection.Definition.ConstDirective.t()
  ],
  name: String.t(),
  types: [
    ExShopifySchema.Generator.Graphql.Introspection.Definition.NamedType.t()
  ]
}

Functions

load_json(json)

@spec load_json(json :: map()) :: t()