Commit 8655f65e authored by ivan's avatar ivan

tested pagination for process resource and events

parent 2d6a74a4
Pipeline #214837414 failed with stage
in 1 minute and 3 seconds
......@@ -258,6 +258,7 @@ defmodule ValueFlows.Observation.EconomicEvent.GraphQL do
queries: ValueFlows.Observation.EconomicEvent.Queries,
query: ValueFlows.Observation.EconomicEvent,
page_opts: page_opts,
cursor_fn: & &1.id,
base_filters: [
:default,
user: GraphQL.current_user(info)
......
......@@ -226,6 +226,7 @@ defmodule ValueFlows.Observation.Process.GraphQL do
# preload: [:provider, :receiver, :tags],
# cursor_fn: Processes.cursor(:followers),
page_opts: page_opts,
cursor_fn: & &1.id,
base_filters: [
:default,
# preload: [:provider, :receiver, :tags],
......
......@@ -307,7 +307,7 @@ defmodule ValueFlows.Observation.EconomicResource.GraphQL do
queries: ValueFlows.Observation.EconomicResource.Queries,
query: ValueFlows.Observation.EconomicResource,
# preload: [:primary_accountable, :receiver, :tags],
# cursor_fn: EconomicResources.cursor(:followers),
cursor_fn: & &1.id,
page_opts: page_opts,
base_filters: [
:default,
......
......@@ -108,12 +108,16 @@ defmodule ValueFlows.Observation.EconomicResource.GraphQLTest do
{:ok, resource} = EconomicResources.soft_delete(resource)
resource
end)
after_resource = List.first(resources)
q = economic_resources_pages_query()
conn = user_conn(user)
vars = %{after: after_resource.id, limit: 2}
assert page = grumble_post_key(q, conn, :economic_resources_pages, %{})
assert page = grumble_post_key(q, conn, :economic_resources_pages, vars)
assert Enum.count(resources) == page["totalCount"]
assert List.first(page["edges"])["id"] == after_resource.id
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment