hasura / hasura/graphql-engine

Unable to order/filter remote database joins

Open
#8,996 3 comments 10 reactions 0 assignees View on GitHub
k/enhancement t/native-dbs
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.