Skip to content

queries with abstract types in a list return null #5983

@JanEggers

Description

@JanEggers

Is there an existing issue for this?

  • I have searched the existing issues

Product

Hot Chocolate

Describe the bug

when having a model with a list of baseclass that is mapped to dtos it returns null.

when orignally encountering the bug graphql will return a list where each object is null.
in the repro i get an error instead: Cannot return null for non-nullable field.

when adding tolist asqueryable in the query type i can see that the data is there

image

also when doing the same query without the dto conversion is working fine

Steps to reproduce

  1. https://github.com/JanEggers/GraphqlRepro
query {
  parents{
    id,
    children{
      id,
      ... on ChildModelA {
        a
      }
      ... on ChildModelB {
        b
      }
    }
  }
  parentDtos{
    id,
    children{
      id,
      ... on ChildDtoA {
        a
      }
    }
  }
}

Relevant log output

No response

Additional Context?

No response

Version

13.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: DataIssue is related to filtering, sorting, pagination or projections🌶️ hot chocolate🔍 investigateIndicates that an issue or pull request needs more information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions