ash_graphql/test/support/resources/constrained_map.ex

30 lines
584 B
Elixir
Raw Normal View History

defmodule AshGraphql.Test.ConstrainedMap do
@moduledoc false
use Ash.Type.NewType,
subtype_of: :map,
constraints: [
fields: [
foo_bar: [
type: :string,
allow_nil?: false
],
baz: [
type: :integer
],
bam: [
type: :map,
constraints: [
fields: [
qux: [
type: :string
]
]
]
]
]
]
def graphql_type(_), do: :constrained_map
def graphql_input_type(_), do: :constrained_map_input
end