hasura / hasura/graphql-engine
[alpha.10] ERROR in table "mytable": in remote relationship "toUser": type "UserWhereInput" is invalid for stripping
- 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"}
```

Contributor 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