-
Notifications
You must be signed in to change notification settings - Fork 683
Description
What happened?
Description
When running a GraphQL mutation that updates or creates entries with Matrix fields, an error occurs if CRAFT_LAZY_GQL_TYPES=true is enabled.
Steps to reproduce
- Enable the environment variable: CRAFT_LAZY_GQL_TYPES=true
- Run a mutation that creates or updates an entry containing Matrix fields.
-
Expected behavior
The mutation should succeed and update the entry correctly.
Actual behavior
The request fails with a GqlException similar to:
{
"errors": [
{
"exception": "craft\errors\GqlException",
"message": "Tried to load an unregistered type "matrix_seitenbloecke_at_MatrixEntryContainerInput".
This can indicate both a typo in the query or an issue with the schema used.",
"file": "/var/www/html/remaxcraft/vendor/craftcms/cms/src/gql/TypeLoader.php",
"line": 39,
"trace": [
{ "file": "/vendor/webonyx/graphql-php/src/Type/Schema.php", "line": 350, "function": "loadType" },
{ "file": "/vendor/webonyx/graphql-php/src/Type/Schema.php", "line": 326, "function": "loadType" },
{ "file": "/vendor/webonyx/graphql-php/src/Utils/AST.php", "line": 579, "function": "getType" },
{ "file": "/vendor/webonyx/graphql-php/src/Utils/AST.php", "line": 569, "function": "typeFromAST" },
{ "file": "/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php", "line": 436, "function": "typeFromAST" },
{ "file": "/vendor/webonyx/graphql-php/src/Language/Visitor.php", "line": 466, "function": "enter" },
{ "file": "/vendor/webonyx/graphql-php/src/Language/Visitor.php", "line": 277, "function": "GraphQL\Language\{closure}" },
{ "file": "/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php", "line": 224, "function": "visit" },
{ "file": "/vendor/webonyx/graphql-php/src/GraphQL.php", "line": 153, "function": "validate" },
{ "file": "/vendor/craftcms/cms/src/services/Gql.php", "line": 534, "function": "executeQuery" },
{ "file": "/vendor/craftcms/cms/src/controllers/GraphqlController.php", "line": 195, "function": "executeQuery" }
]
}
]
}
Craft CMS version
5.8.19
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response