Skip to content

Commit

Permalink
fix(graphene): avoid default connection limit
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx authored and czosel committed Mar 15, 2022
1 parent f1a5cc0 commit edaf287
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions caluma/caluma_core/tests/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,26 @@ def test_offset_pagination(

assert not result.errors
assert len(result.data["allQuestions"]["edges"]) == expected_count


def test_no_default_limit(db, schema_executor, question_factory):
question_factory.create_batch(120)

query = """
query {
allQuestions {
totalCount
edges {
node {
id
}
}
}
}
"""

result = schema_executor(query)

assert not result.errors
assert result.data["allQuestions"]["totalCount"] == 120
assert len(result.data["allQuestions"]["edges"]) == 120
6 changes: 5 additions & 1 deletion caluma/settings/caluma.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def default(default_dev=env.NOTSET, default_prod=env.NOTSET):

# GraphQL

GRAPHENE = {"SCHEMA": "caluma.schema.schema", "MIDDLEWARE": []}
GRAPHENE = {
"SCHEMA": "caluma.schema.schema",
"MIDDLEWARE": [],
"RELAY_CONNECTION_MAX_LIMIT": None,
}

# OpenID connect

Expand Down

0 comments on commit edaf287

Please sign in to comment.