Skip to content

[5.x]: GraphQL: EntryRelationCriteriaInput not defined when lazyGqlTypes=true #17858

@internetztube

Description

@internetztube

What happened?

Description

When executing a GraphQL query that declares a variable of type EntryRelationCriteriaInput (used as relatedToEntries on entries), the request fails with:

Tried to load an unregistered type "EntryRelationCriteriaInput". This can indicate both a typo in the query or an issue with the schema used.

This only occurs when lazyGqlTypes=true. With lazy loading disabled, the same query runs successfully.

Query:

query ($relatedToEntries: [EntryRelationCriteriaInput]){
  entries {
    id
  }
}

Response:

{
  "errors": [
    {
      "exception": "craft\\errors\\GqlException",
      "message": "Tried to load an unregistered type \"EntryRelationCriteriaInput\". This can indicate both a typo in the query or an issue with the schema used.",
      "file": "/app/vendor/craftcms/cms/src/gql/TypeLoader.php",
      "line": 39,
      "trace": [
        {
          "file": "/app/vendor/webonyx/graphql-php/src/Type/Schema.php",
          "line": 350,
          "function": "loadType",
          "class": "craft\\gql\\TypeLoader",
          "type": "::"
        },
        {
          "file": "/app/vendor/webonyx/graphql-php/src/Type/Schema.php",
          "line": 326,
          "function": "loadType",
          "class": "GraphQL\\Type\\Schema",
          "type": "->"
        },
        {
          "file": "/app/vendor/webonyx/graphql-php/src/Utils/AST.php",
          "line": 579,
          "function": "getType",
          "class": "GraphQL\\Type\\Schema",
          "type": "->"
        },

Craft CMS version

5.9.x (shows 5.8.17 (Pro) in utils)

PHP version

8.3.17

Operating system and version

Darwin 24.6.0 (via ghcr.io/craftcms/image:8.3)

Database type and version

PostgreSQL 13.3

Image driver and version

GD 8.3.17

Installed plugins and versions

  • Amazon S3 2.2.3
  • Amazon SES 3.1.0
  • CKEditor 4.10.1
  • Code Field 5.0.1
  • Control Panel CSS 3.0.0
  • Control Panel JS 3.0.0
  • CP Field Inspect 2.0.4
  • Element Relations 3.0.11.1
  • Feed Me 6.10.1
  • Guide 5.3.3
  • Hyper 2.2.8
  • Icon Picker 3.0.6
  • ImageOptimize 5.0.7
  • Navigation 3.0.12
  • Neo 5.4.5
  • Preparse 3.0.0-alpha.2
  • Redactor 4.2.0
  • Redirects 5.0.12
  • SEOmatic 5.1.17
  • Static Translations 4.2.1
  • Super Dynamic Fields 5.0.1
  • Super Table 4.0.5
  • Translations v4.1.4
  • Workflow 3.0.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions