Skip to content

Commit

Permalink
Use ?_nofacet=1, closes #76
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 16, 2021
1 parent 289484d commit adc8e35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion datasette_graphql/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ async def resolve_table(
if kwargs.get(pk) is not None:
pairs.append([pk, kwargs[pk]])

qs = {}
qs = {
"_nofacet": 1,
}
qs.update(pairs)
if after:
qs["_next"] = after
Expand Down
4 changes: 2 additions & 2 deletions tests/test_graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ async def test_time_limit_ms(db_path):
assert len(response_json["errors"]) == 1
assert response_json["errors"][0]["message"].startswith("Time limit exceeded: ")
assert response_json["errors"][0]["message"].endswith(
" > 0.1ms - /test/repos.json?_size=10&_search=dogspotter"
" > 0.1ms - /test/repos.json?_nofacet=1&_size=10&_search=dogspotter"
)


Expand Down Expand Up @@ -591,7 +591,7 @@ async def test_num_queries_limit(db_path):
},
"errors": [
{
"message": "Query limit exceeded: 3 > 2 - /test/repos.json?_size=10&owner=2",
"message": "Query limit exceeded: 3 > 2 - /test/repos.json?_nofacet=1&_size=10&owner=2",
"locations": [{"line": 7, "column": 17}],
"path": ["users", "nodes", 1, "repos_list"],
}
Expand Down

0 comments on commit adc8e35

Please sign in to comment.