View Source Bonfire.API.GraphQL.Fields (bonfire v0.3.5-classic-beta.7)

Link to this section 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

Link to this section Types

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

Link to this section 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()