StrawHat v0.1.0 StrawHat.GraphQL.MutationResponse View Source

Absinthe Mutation Response utilities. Normally will be use in Absinthe resolvers.

Link to this section Summary

Types

  • successful: When the mutation succeeded or not.
  • payload: Data of the mutation payload.
  • errors: List of StrawHat.Error

Functions

Returns a failed mutation response map

Returns a succeeded mutation response map

Link to this section Types

Link to this type mutation_response() View Source
mutation_response() :: %{successful: boolean, payload: any, errors: [StrawHat.Error.t]}
  • successful: When the mutation succeeded or not.
  • payload: Data of the mutation payload.
  • errors: List of StrawHat.Error.

Link to this section Functions

Link to this function failed(changeset) View Source
failed(Ecto.Changeset.t) :: {:ok, mutation_response}
failed(StrawHat.Error.t) :: {:ok, mutation_response}
failed(StrawHat.Error.ErrorList.t) :: {:ok, mutation_response}
failed(any) :: no_return

Returns a failed mutation response map.

Link to this function succeeded(payload) View Source
succeeded(any) :: {:ok, mutation_response}

Returns a succeeded mutation response map.