Skip to main content

Magento GraphQL ProductInterface Error Caused by Incorrect Product Type Casing

Magento GraphQL ProductInterface Error Caused by Incorrect Product Type Casing
Issue
GraphQL responses returned null for some products along with the error:
Concrete type for ProductInterface not implemented
Root Cause
Magento stores product types in the type_id column (e.g., simple, configurable). These values must be lowercase. Some products were saved with incorrect casing such as Simple instead of simple.

Although MySQL comparisons are typically case-insensitive, Magento GraphQL resolves product types in PHP, which is case-sensitive. Because of this, Simple does not match the expected simple, so GraphQL fails to map the product to a valid type like SimpleProduct, resulting in null values.
How to Identify the Problem
Run a case-sensitive query to find all incorrectly cased values:
SELECT entity_id, sku, type_id FROM catalog_product_entity WHERE BINARY type_id != LOWER(type_id);
This query returns all products where type_id contains uppercase characters.
How to Fix
Normalize all type_id values to lowercase:
UPDATE catalog_product_entity SET type_id = LOWER(type_id) WHERE BINARY type_id != LOWER(type_id);
Post-Fix Steps
Reindex and clear cache to apply the changes:
bin/magento indexer:reindex
bin/magento cache:flush
Prevention
Review any custom scripts, imports, or integrations that create or update products. Ensure they always set product types using lowercase values, for example:
setTypeId('simple') instead of setTypeId('Simple').
Result
After applying the fix, GraphQL correctly resolves all product types, and the null entries and errors are eliminated.