hasura / hasura/graphql-engine

[alpha.10] ERROR in table "mytable": in remote relationship "toUser": type "UserWhereInput" is invalid for stripping

Open
#6,894 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Hi,

Trying to add a remote schema relationship that involves more than 1 remote fields.

Sending:
```
{"type":"bulk","source":"default","resource_version":10,"args":[{"type":"pg_create_remote_relationship","args":{"name":"toUser","remote_schema":"MyDB","remote_field":{"findFirstUser":{"arguments":{"where":{"AND":{"id":{"equals":"$from"}},"id":{"equals":"$company_id"}}}}},"hasura_fields":["from","company_id"],"table":{"name":"mytable","schema":"public"},"source":"default"}}]}
```
Response:
```
{"internal":[{"definition":{"remote_field":{"findFirstUser":{"arguments":{"where":{"AND":{"id":{"equals":"$from"}},"id":{"equals":"$company_id"}}}}},"name":"toUser","hasura_fields":["company_id","from"],"remote_schema":"MyDB","source":"default","table":{"schema":"public","name":"mytable"}},"reason":"in table \"mytable\": in remote relationship\"toUser\": type \"UserWhereInput\" is invalid for stripping","type":"remote_relationship"}],"path":"$.args[0].args","error":"in table \"mytable\": in remote relationship\"toUser\": type \"UserWhereInput\" is invalid for stripping","code":"constraint-violation"}
```
![image](https://user-images.githubusercontent.com/1680627/117688600-d58bc700-b1b0-11eb-8ae8-0ea4c5a0e28e.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the pg_create_remote_relationship bulk request from the issue, focusing on the remote_field with multiple hasura_fields and its UserWhereInput error. Trace the remote relationship validation path and determine the expected handling for the multi-field where input; the issue provides no file or test to target, so completion should include a regression check showing the request is handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgres
Domain
api, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.