hasura / hasura/graphql-engine
Restrict columns which are available to WHERE clause
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
I have the following DB table:
```
users:
- id
- first_name
- last_name
- email
- phone
- address
```
On this table, I only have indexes on the following columns: `id`, `first_name`, `last_name`, `email`.
The `phone` and `address` columns are NOT indexed.
Is it possible to restrict the set of allowed columns in a graphql WHERE clause to only the indexed columns? Further than that, is it possible to restrict the set of allowed operators at the column level?
If I do not have a database index on a column, or have specific kinds of indices, certain graphql queries would have poor performance, so I want to restrict the set of allowed WHERE queries to only those that would be performant.
Contributor guide
Research direction
Start by reviewing how Hasura defines GraphQL WHERE-clause fields and operators for the database table described in the issue. Determine whether indexed columns and allowed operators can be restricted at column level; done means the supported configuration and its performance-related limits are documented or implemented with coverage for the requested restrictions.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100