Skip to content

Commit 02e338a

Browse files
Prevent 'adapter does not support keyword or interpolated fragments in query' error
1 parent cc133c7 commit 02e338a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/graphql/relay/connection/ecto.ex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ if Code.ensure_loaded?(Ecto) do
1919
limit = Enum.min([first, last, connection_count(repo, query)])
2020

2121
query = if a_after do
22-
frag = [{where_property, [>: a_after]}]
23-
query |> where(fragment(^frag))
22+
query |> where([a], field(a, ^where_property) > ^a_after)
2423
else
2524
query
2625
end
2726

2827
query = if before do
29-
frag = [{where_property, [<: before]}]
30-
query |> where(fragment(^frag))
28+
query |> where([a], field(a, ^where_property) < ^before)
3129
else
3230
query
3331
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule GraphQL.Relay.Mixfile do
22
use Mix.Project
33

4-
@version "0.4.0"
4+
@version "0.4.1"
55
@description "Relay helpers for GraphQL Elixir"
66
@repo_url "https://github.com/graphql-elixir/graphql_relay"
77

0 commit comments

Comments
 (0)