这是indexloc提供的服务,不要输入任何密码
Skip to content

Object relationship in a SQL view is nullable but shouldn't be #7662

@MatrixFrog

Description

@MatrixFrog

Version Information

Server Version: v2.0.8-cloud.3

Environment

Hasura Cloud and OSS

What is the expected behaviour?

I set up a small repro case at https://nullable.hasura.app/v1/graphql -- happy to add anyone as a collaborator on it so you can see the setup. It's just a database with two tables, foo and bar, and a view foo_view which is essentially just a copy of foo.

foo and foo_view both have a 'bar_id' column and an object relationship to the 'bar' table.

foo.bar is non-nullable (as I would expect) and foo_view.bar is nullable (as I would not expect)

You can see this by running graphqurl:

gq https://nullable.hasura.app/v1/graphql --introspect

and looking for type foo (containing non-nullable bar!) and type foo_view (containing nullable bar) in the output:

"""
columns and relationships of "foo"
"""
type foo {
  """An object relationship"""
  bar: bar!
  bar_id: Int!
  id: Int!
}
"""
columns and relationships of "foo_view"
"""
type foo_view {
  """An object relationship"""
  bar: bar
  bar_id: Int
  id: Int
}

Keywords

nullable, object relationship, sql view

Metadata

Metadata

Assignees

No one assigned

    Labels

    k/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions