hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.18k stars 2.77k forks source link

Creating relationships from foreign key fails for DB with namespace #9104

Open jmrossy opened 2 years ago

jmrossy commented 2 years ago

Environment

Hasura Cloud

What is the current behaviour?

When using two databases with conflicting schema, the use of a namespace can help avoid conflicts. But when I try to create relationships from the foreign keys detected in a database under a namespace, the creation hits an error:

Creating relationship failed

Found conflicting definitions for 'MY_TABLE_bool_exp'. The definition at query_root.testnet2.domain.where differs from the the definitions [query_root.MY_NAMESPACE.MY_TABLE_aggregate.where...

What is the expected behaviour?

Relationships get created without error

How to reproduce the issue?

  1. Connect to two postgresql dbs in with the same schema in the same hasura instance
  2. Add unique namespaces for each in the Root Fields setting
  3. Attempt to create relationships from foreign keys

Screenshots or Screencast

Screen Shot 2022-10-12 at 17 07 02

Keywords

Postgresql foreign key relationship root fields namespace

Morganyyu commented 2 years ago

+1 on this, exact same scenario

mbrevda commented 1 year ago

dup of https://github.com/hasura/graphql-engine/issues/7436?

rosjerry commented 1 year ago

same problem