Skip to content

Commit

Permalink
Merge pull request #171 from absinthe-graphql/remove-undesirable-lateral
Browse files Browse the repository at this point in the history
Revert undesirable lateral
  • Loading branch information
benwilson512 authored May 24, 2024
2 parents f1db9ae + f0b372b commit c19fec8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/dataloader/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ if Code.ensure_loaded?(Ecto) do
records = records |> Enum.map(&Map.put(&1, field, empty))

results =
if query.limit || query.offset || Enum.any?(query.order_bys) do
if query.limit || query.offset do
records
|> preload_lateral(field, query, source.repo, repo_opts)
else
Expand Down
2 changes: 1 addition & 1 deletion test/dataloader/ecto_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ defmodule Dataloader.EctoTest do
assert message =~ "Cardinality"
end

describe "has_many through:" do
describe "many_to_many" do
test "basic loading works", %{loader: loader} do
user1 = %User{username: "Ben Wilson"} |> Repo.insert!()
user2 = %User{username: "Bruce Williams"} |> Repo.insert!()
Expand Down
2 changes: 1 addition & 1 deletion test/support/post.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Dataloader.Post do
belongs_to(:user, Dataloader.User)
has_many(:likes, Dataloader.Like)
has_many(:scores, Dataloader.Score)
has_many(:liking_users, through: [:likes, :user])
many_to_many(:liking_users, Dataloader.User, join_through: Dataloader.Like)

field(:title, :string)
field(:status, :string)
Expand Down

0 comments on commit c19fec8

Please sign in to comment.