ExShopifySchema.Generator.Graphql.Schema (ExShopifySchema v2025.1.2)

View Source

Schemas to cast Shopify resources into structured data.

loadable_field

Same usage as Ecto.Schema.field/3 but with a default value of ExShopifySchema.Graphql.Schema.FieldNotLoaded.

In GraphQL, fields are not always loaded, so we use this default value to indicate that a field is not loaded. Otherwise, we would have to use nil which would be ambiguous.

Usage

defmodule ExShopifySchema.Generator.Graphql.Schemas.Shop do
  use ExShopifySchema.Generator.Graphql.Schema

  @primary_key false
  typed_embedded_schema do
    loadable_field :id, :string
    loadable_field :name, :string
  end
end

Summary

Functions

Same usage as Ecto.Schema.field/3 but with a default value of ExShopifySchema.Graphql.Schema.FieldNotLoaded. Source: https://github.com/elixir-ecto/ecto/blob/v3.11.1/lib/ecto/schema.ex#L750

Functions

loadable_field(name, type, opts \\ [])

(macro)

Same usage as Ecto.Schema.field/3 but with a default value of ExShopifySchema.Graphql.Schema.FieldNotLoaded. Source: https://github.com/elixir-ecto/ecto/blob/v3.11.1/lib/ecto/schema.ex#L750