Packages

The extension for building GraphQL APIs with Ash

Current section

Files

Jump to
ash_graphql lib resource helpers.ex
Raw

lib/resource/helpers.ex

# SPDX-FileCopyrightText: 2020 ash_graphql contributors <https://github.com/ash-project/ash_graphql/graphs/contributors>
#
# SPDX-License-Identifier: MIT
defmodule AshGraphql.Resource.Helpers do
@moduledoc "Imported helpers for the graphql DSL section"
@doc """
A list of a given type, idiomatic for those used to `absinthe` notation.
"""
@spec list_of(v) :: {:array, v} when v: term()
def list_of(value) do
{:array, value}
end
@doc """
A non nullable type, idiomatic for those used to `absinthe` notation.
"""
@spec non_null(v) :: {:non_null, v} when v: term()
def non_null(value) do
{:non_null, value}
end
end