question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System-wide default paging/row limit

See original GitHub issue

Hi,

is there a way to define default/implicit paging limits some way? Because if I have a database with a million records and a client sends a query like:

query {
    publication {
        id
        title
    }
}

… it would return a million items as result. It would be great if I could set an overall limit or a per table limit on the number of elements that can be returned in a single query. Let’s say I set the max paging limit to 100, with that setting a query without an explicit limit would become

query {
    publication(limit: 100) {
        id
        title
    }
}

Also this would prevent malicious clients setting too big limits. So, even if the query is

query {
    publication(limit: 50000) {
        id
        title
    }
}

it would become:

query {
    publication(limit: 100) {
        id
        title
    }
}

Is there such a mechanism in Hasura?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
0x777commented, Oct 28, 2019

This should be fairly trivial to add (buildSelPermInfo has to change), the behaviour should be as follows: if the global_limit is set, it is used when limit is not specified in select permission definition, however if limit is specified in a select permission definition, it takes precedence over global_limit.

2reactions
rikinskcommented, Oct 22, 2019

Hi. There is no way to set a blanket value for this setting across all queries. But https://docs.hasura.io/1.0/graphql/manual/auth/authorization/permission-rules.html#row-fetch-limit would be of help. You can set the limit for a table / role tuple. This will provide you with a more granular control over what roles can fetch how much data of a particular type in a single request

Read more comments on GitHub >

github_iconTop Results From Across the Web

Virtual System Administrator - Kaseya R95 Documentation
Right clicking the Default Web Site and selecting Properties. ... The platform's architecture is central to providing maximum security.
Read more >
ESI Communications Servers Programming - Yumpu
The maximum configuration for this system is 108 ports, which could be achievedby ... Default: System-wide.1VIP Professional, VIP ACD Agent, ...
Read more >
Synergy SIS System Administrator Guide - PDF Free Download
This guide illustrates the setup of system-wide options in the System module, ... Enforce Linked Section Gender and Grade Restrictions (Y/N) Default Locker ......
Read more >
Full text of "Intel-IEEE Proposed Microcomputer System Bus ...
16-bit decoding is used for all I/O addresseSi A default fixed decode is ... In sleep mode, refresh switches to CAS# be- fore...
Read more >
En VSAguide62 | PDF | Antivirus Software | Installation (Computer ...
Finally, for maximum web security, the VSA web pages fully support operating as ... Click Set as System Default to set a system-wide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found