View Source GlificWeb.Resolvers.Flows (Glific v5.1.6)

Flow Resolver which sits between the GraphQL schema and Glific Flow Context API. This layer basically stitches together one or more calls to resolve the incoming queries.

Link to this section Summary

Functions

Get broadcast stats for a flow

Make a copy a flow

Get the count of flows filtered by args

Get a specific flow by id

Grab a flow or nil if possible for this user

Release a flow or nil if possible for this user

Get the list of flows

Publish a flow

Reset the flow counts for a specific flow

Resume a flow for a contact

Start a flow for a contact

Start a flow for all contacts of a group

Terminate all flows for a contact

Link to this section Functions

Link to this function

broadcast_stats(_, map, _)

View Source
@spec broadcast_stats(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Get broadcast stats for a flow

@spec copy_flow(Absinthe.Resolution.t(), %{id: integer(), input: map()}, %{
  context: map()
}) ::
  {:ok, any()} | {:error, any()}

Make a copy a flow

@spec count_flows(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, integer()}

Get the count of flows filtered by args

@spec flow(Absinthe.Resolution.t(), %{id: integer()}, %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Get a specific flow by id

Link to this function

flow_get(_, params, map)

View Source
@spec flow_get(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Grab a flow or nil if possible for this user

Link to this function

flow_release(_, params, map)

View Source
@spec flow_release(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Release a flow or nil if possible for this user

@spec flows(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, [Glific.Flows.Flow]}

Get the list of flows

@spec publish_flow(Absinthe.Resolution.t(), %{uuid: String.t()}, %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Publish a flow

Link to this function

reset_flow_count(_, map, _)

View Source
@spec reset_flow_count(Absinthe.Resolution.t(), map(), %{context: map()}) ::
  {:ok, any()} | {:error, any()}

Reset the flow counts for a specific flow

Link to this function

resume_contact_flow(_, map1, map2)

View Source
@spec resume_contact_flow(
  Absinthe.Resolution.t(),
  %{flow_id: integer() | String.t(), contact_id: integer(), result: map()},
  %{context: map()}
) :: {:ok, any()} | {:error, any()}

Resume a flow for a contact

Link to this function

start_contact_flow(_, params, map)

View Source
@spec start_contact_flow(
  Absinthe.Resolution.t(),
  %{flow_id: integer() | String.t(), contact_id: integer()},
  %{context: map()}
) :: {:ok, any()} | {:error, any()}

Start a flow for a contact

Link to this function

start_group_flow(_, params, map)

View Source
@spec start_group_flow(
  Absinthe.Resolution.t(),
  %{flow_id: integer(), group_id: integer()},
  %{
    context: map()
  }
) :: {:ok, any()} | {:error, any()}

Start a flow for all contacts of a group

Link to this function

terminate_contact_flows(_, map, context)

View Source
@spec terminate_contact_flows(
  Absinthe.Resolution.t(),
  %{contact_id: integer()},
  map()
) :: {:ok, any()} | {:error, any()}

Terminate all flows for a contact