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

v3: supergraph errors out while building (having a table named "text") #10570

Open meetzaveri opened 3 weeks ago

meetzaveri commented 3 weeks ago

Component

c/v3-engine, c/v3-ndc-postgres

What is the current behaviour?

If you have a DB with table named text , then you'll face the below error while building supergraph locally.

6:38PM ERR Code=opendds-validation 
Message="invalid metadata: error building schema: invalid metadata: 
unknown type represented for scalar type text: Text (in subgraph app)"

Further in investigation, I also saw that there is HML error in connector-types file as per the screenshot. Scalar Type "Text" is not defined.HML(err-invalid-reference)

Screenshot 2024-10-15 at 1 43 11 PM

What is the expected behaviour?

The ndc types generated by the postgres connector contain both a scalar type and an object type named text . In my understanding this is invalid.

The supergraph build should succeed given if there is correct mapping provided.

How to reproduce the issue?

Assuming you've already pre-requisites for DDN as per this doc

  1. Create a supabase DB with a table named text and provide some dummy columns
  2. Follow Hasura DDN quickstart as per this doc
  3. While running ddn supergraph build local, you'll face such error

Alternatively, there is already a GH repo here (it's only available internally for hasura members) where you can clone and reproduce the issue straight away. All env vars with values are setup and source controll-ed in there.

Screenshots or Screencast

Already provided above in description

Any possible solutions/workarounds you're aware of?

As of now, we don't have such.

Keywords

ddn connector metadata

Note: This is already being tracked in linear issue for ndc-postgres and engine. For public seeing this GH issue, linear is only visible to engineering team. But we'll update this GH issue based on the updates on Linear issue.

ronit-sh commented 1 day ago

Any update?