mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-21 13:53:20 +12:00
30 lines
578 B
Elixir
30 lines
578 B
Elixir
|
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
|