Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting limits on entities returned #831

Open
ramnivas opened this issue Jun 23, 2023 · 0 comments
Open

Allow setting limits on entities returned #831

ramnivas opened this issue Jun 23, 2023 · 0 comments

Comments

@ramnivas
Copy link
Contributor

ramnivas commented Jun 23, 2023

Currently, when executing a query such as the following, Exograph returns all products.

products {
  id
  name
}

We should:

  1. Allow configuring a global, say, EXO_QUERY_ENTRIES_LIMIT (default to, say, 100)
  2. Allow a per-type configuration (@maxLimit(100))

Then we automatically compute the effective limit as:

min(the `limit` parameter specified in the query, the configured limit)

where the configured limit is:

per-type configuration, if specified, or `EXO_QUERY_ENTRIES_LIMIT`

Then we execute the query as if the user has specified the limit parameter:

products(limit: <the computed limit>) {
  id
  name
}

Open question:
We need to indicate to the caller that their limit (either explicitly specified or implied as Infinity) was overridden. What's the best way to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant