Skip to content

Hasura relationships should detect if the joined column types are compatible #10803

@trivedi

Description

@trivedi

Is your proposal related to a problem?

Hasura allows you to create relationships between different tables.

Image

However, it does not validate that the column types are the same. It throws a runtime error when it attempts to generate the underlying database query.

The runtime error message returned is also quite vague and does help diagnose where the problem is coming from:

{
  "errors": [
    {
      "message": "database query error",
      "extensions": {
        "path": "$",
        "code": "unexpected"
      }
    }
  ]
}

Describe the solution you'd like

Hasura already knows the column types in your table, so it should theoretically be possible to add validation in the UI. Ideally, it throws an error when creating the relationship with incompatible column types.

Describe alternatives you've considered

Another idea would be to show the column types that are being joined in the UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    k/enhancementNew feature or improve an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions