Skip to content

[GraphQl] Error in response when value is null #3465

Description

@alexia-soares

API Platform version(s) affected: 2.5.4

Description
When a selected field is empty in database, the reponse of a GraphQl request contains the following error, but the result is still correct. The GraphQl query is correct and when I fill this data in DB, error disappears.

query :

{
  item(id: "cc429bad-960a-4b1d-94bc-7188f8f7a8c0") {
    id
    name
    emails
  }
}

error :

{
  "errors": [
    {
      "message": "Resource class cannot be determined.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "path": [
        "item",
        "emails"
      ]
    }
  ],
  "data": {
    "item": {
      "id": "cc429bad-960a-4b1d-94bc-7188f8f7a8c0",
      "name": "Item name",
      "emails": null
    }
  }
}

This error appears after apiplatform/core upgrade from 2.4.5 to 2.5.4.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions