View Source Bonfire.API.GraphQL.Fields (Bonfire v0.9.10-classic-beta.169)

Summary

Functions

Returns the result corresponding to the given key, or the given default (or nil).

Returns a post-batch callback function which calls get with the provided key and optional default value (or nil).

Creates a new Fields from the data and a grouping function

Types

@type t() :: %Bonfire.API.GraphQL.Fields{data: map()}

Functions

Link to this function

get(fields, key, default \\ nil)

View Source
@spec get(fields :: t(), key :: term(), default :: term()) :: term()

Returns the result corresponding to the given key, or the given default (or nil).

Link to this function

getter(key, default \\ nil)

View Source
@spec getter(key :: term(), default :: term()) :: (%{required(term()) => term()} ->
                                               term())

Returns a post-batch callback function which calls get with the provided key and optional default value (or nil).

@spec new(data :: [term()], group_fn :: (term() -> term())) :: t()

Creates a new Fields from the data and a grouping function

Link to this function

new(data, group_fn, map_fn)

View Source
@spec new(
  data :: [term()],
  group_fn :: (term() -> term()),
  map_fn :: (term() -> term())
) :: t()