ExShopifySchema.Types (ExShopifySchema v2025.4.3)

View Source

This module provides utility functions for defining types.

Summary

Functions

make_sum_type(types)

@spec make_sum_type([atom(), ...]) :: Macro.t()

Make sum type.

Example

iex> ExShopifySchema.Types.make_sum_type([:foo, :bar, :baz])
quote do :foo | :bar | :baz end

Usage

defmodule MyApp.MyType do
  @type t() :: unquote(ExShopifySchema.Types.make_sum_type([:foo, :bar, :baz]))
  # equals to
  @type t_equivalent() :: :foo | :bar | :baz
end