Dialyxir error when using `Ecto.Query.t` as function argument

The specs for your functions seem to be valid, dialyzer complains about the calls.

x = from …
y = x
|> function1()
|> function2()
|> limit(10)

function3(y)

will probably be fine.

Unless you are running the query in function3/1, you can also swap the ordering:

x = from …
x
|> function1()
|> function2()
|> function3()
|> limit(10)