hasura / hasura/graphql-engine

Remote Schema - Not allowing to create complex relationship querys

Open
#8,673 0 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
CLI Version (for CLI related issue): 2.8.4

### Environment

Cloud/ OSS

### What is the current behavior?

When I'm trying to use **or** operation from objkt GraphQL API by stitching the remote schema and local table the Hasura engine is not allowing it.

Remote Schema: https://data.objkt.com/v2/graphql

```
{ "internal": [ { "definition": { "remote_field": { "event": { "arguments": { "where": { "_or": { "recipient_address": { "_eq": "$auth_provider_unique_id" }, "creator_address": { "_eq": "$auth_provider_unique_id" } } } } } }, "name": "event", "hasura_fields": [ "auth_provider_unique_id" ], "remote_schema": "objkt", "source": "default", "table": { "schema": "public", "name": "account_providers" } }, "reason": "Inconsistent object: in table \"account_providers\": in remote relationship\"event\": type \"event_bool_exp\" is invalid for stripping", "name": "remote_relationship event in table account_providers in source default", "type": "remote_relationship" } ], "path": "$.args[0].args", "error": "Inconsistent object: in table \"account_providers\": in remote relationship\"event\": type \"event_bool_exp\" is invalid for stripping", "code": "invalid-configuration" }
```

### What is the expected behavior?

- The system should allow me to map any level of nesting in the query arguments.

### How to reproduce the issue?

1. Add a remote schema https://data.objkt.com/v2/graphql
2. Create db table auth_providers
3. Try to create a remote relationship which matches the graphql query getEvent

Query

```
query getEvent{
event(where: {
timestamp: {
_is_null: false
},
_or: [
{
creator_address: {
_eq: $auth_provider_unique_id
}
},
{
recipient_address: {
_eq: $auth_provider_unique_id
}
}
]
}) {
id
}
}
```

auth_providers
```
id- uuid, primary key, unique, default: gen_random_uuid()
created_at- timestamp with time zone, default: now()
updated_at- timestamp with time zone, default: now()
account_id- uuid, nullable
auth_provider- text
auth_provider_unique_id- text, unique
metadata- jsonb, nullable
```

### Screenshots or Screencast

https://vimeo.com/727749588/3e8923073b

### Keywords

Remote Schema
Relationship

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.