ExShopifySchema
A collection of Elixir schemas for Shopify resources.
Installation
The package can be installed by adding ex_shopify_schema
to your list of dependencies in mix.exs:
def deps do
[
{:ex_shopify_schema, "~> <SHOPIFY_VERSION>.patch"}
# for example: {:ex_shopify_schema, "~> 2025.7.4"}
]
endDocumentation can be found at https://hexdocs.pm/ex_shopify_schema.
Configuration
You can configure how Ecto types are handled by adding the following to your config.exs:
config :ex_shopify_schema, :ecto_types,
enum: :atom, # or :string
uri: :struct # or :stringAvailable Options
:enum- Controls how GraphQL enum values are handled::atom(default) - Enum values are treated as atoms:string- Enum values are treated as strings
:uri- Controls how URI/URL fields are handled::struct(default) - URI values are returned asURI.t()structs:string- URI values are returned as plain strings
Mix Tasks
mix ex_shopify_schema.download.introspection <YYYY-MM>— Downloads the Shopify GraphQL Admin API introspection JSON for the given version and saves it topriv/graphql/introspections/<YYYY-MM>.json. Pass--forceto overwrite an existing file.mix ex_shopify_schema.gen.graphql_schemas— Generates the Ecto schema modules underlib/ex_shopify_schema/graphql/from the introspection JSON for the version inSHOPIFY_VERSION(or theSHOPIFY_VERSIONenv var). Pass--quietto suppress per-file output.
Releasing
Releases are published to Hex automatically by .github/workflows/publish.yml
when a tag is pushed. The workflow builds and publishes one Hex package per
Shopify API version listed in its matrix.
Patch release (no new Shopify version)
-
Bump
@patch_numberinmix.exs. -
Create a release at https://github.com/TeamLunaris/ex_shopify_schema/releases
with tag
v#{@patch_number}(e.g.v6). - The publish workflow runs on the new tag.
Adding a new Shopify API version
See the Shopify release schedule for available versions.
Tip: If you use Claude Code, run
/add-shopify-version <YYYY-MM>to walk through these steps automatically. The skill lives at.claude/skills/add-shopify-version/.
Download the introspection JSON for the new version:
mix ex_shopify_schema.download.introspection 2025-10Bump
@patch_numberinmix.exs.Add the new version to the
shopify-versionmatrix in.github/workflows/publish.yml.Create a release at https://github.com/TeamLunaris/ex_shopify_schema/releases with tag
v#{@patch_number}.The publish workflow runs on the new tag and publishes a package per matrix entry.