hasura / hasura/graphql-engine
Unable to order/filter remote database joins
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.11.2
### Environment
OSS
### What is the current behaviour?
I'm unable to use remote relationships in "where" or "order by" clauses.
The [remote database relationships documentation](https://hasura.io/docs/latest/schema/postgres/remote-relationships/remote-source-relationships/) doesn't mention that "remote" data can't be filtered or sorted.
So I'm not sure if this is a bug or feature request.
### What is the expected behaviour?
I want to use remote relationships in "where" or "order by" clauses.
### How to reproduce the issue?
Just follow the example from the [official documentation](https://hasura.io/docs/latest/schema/postgres/remote-relationships/remote-source-relationships/).
You can join `orders` and `users`, but you can't filter or sort by `users`, only `orders`.
### Screenshots or Screencast
N/A
### Please provide any traces or logs that could help here.
N/A
### Any possible solutions?
Could create a reverse remote relationship (from `users` to `orders` in the docs)
But I still wouldn't be able to filter/sort on both sides at once.
e.g. find joe's orders > $50
### Can you identify the location in the source code where the problem exists?
no
### If the bug is confirmed, would you be willing to submit a PR?
no
Contributor guide
Research direction
Start with the remote source relationships documentation and reproduce the orders/users example described in the issue. Determine whether filtering and ordering across remote relationships are intended to be supported; done should either add that capability with coverage for combined filters and ordering, or update the documentation to clearly state the limitation and supported alternatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postgres
- Domain
- api, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100