Merging the results of Ecto.Multi

Is it ok to merge the results of an Ecto.Multi?


multi =
  |> Multi.insert(:profile, Profile.changeset(%Profile{}, attrs))
  |>, fn _, %{profile: %{id: id}} ->
    UsersProfiles.create_users_profile(%{user_id:, profile_id: id})
  |>, fn _, %{profile: %{id: id}} ->
    Teachers.create_teacher(Map.put(attrs.teacher, :profile_id, id))
  |> Repo.transaction()

{:ok, %{profile: profile, teacher: teacher}} = multi

%Profile{profile | teacher: teacher}

Ecto.Multi would return the values like this:

  {:ok, %{
    profile: %Profile{},
    user_profile: %UserProfile{},
    teacher: %Teacher{}

But because I’m using Absinthe I need teacher to be within the profile as the default/auto resolver can get the teacher fields.