Skip to content

"Could not resolve the actual object type" error when null returned in list of interfaces #3594

@gao-artur

Description

@gao-artur

Schema

type Query{
  test: [BaseType]
}
interface BaseType {
  name: ID!
}
type ConcreteType implements BaseType {
  name: ID!
}

Query

query {
  test {
    __typename
  }
}

Response

{
  "errors": [
    {
      "message": "Could not resolve the actual object type from `HotChocolate.Language.NullValueNode` for the abstract type `test`.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "test",
        0
      ]
    }
  ],
  "data": {
    "test": [
      null
    ]
  }
}

Expected behavior
null should be returned in list without errors.

Additional context
HC v11.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: StitchingIssue is related to schema stitching / federationArea: Type SystemIssue is related to the Type System⌛ staleNothing happened with this issue in quite a while🌶️ hot chocolate

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions