Shopifex.Shop (Shopifex v2.1.20) View Source

A specification for how Shopifex is to interact with your Shopify shops table.

Options

  • :url_field - the field which Shopifex will use to find a shop by url. Defaults to :url
  • :filters - a list of tuples to be used as filter keys which Shopifex will use when loading your shop from your database table. Defaults to []
  • :preloads - a list of preloads which Shopifex will pass unchanged to MyApp.Repo.preload/2

Example:

defmodule MyApp.CommercePlatformInstallation do
  use MyApp.Schema
  use Shopifex.Shop, url_field: :installation_identifier, filters: [{:platform, "shopify"}, {:disabled_at, nil}]

  schema "commerce_platform_installations" do
    field(:installation_identifier, :string)
    field(:provider, :string, default: "shopify")
    field(:disabled_at, :utc_datetime)
    # ...
  end
end