In Sitecore 10.4, custom field type mappings are not supported for the Sitecore Experience Edge for XM Preview GraphQL endpoint.
The Edge Preview endpoint uses a mirrored schema that is intended to match the schema and behavior of Sitecore Experience Edge for XM. Because of this, custom mappings added through the fieldTypeMappings configuration node or through a custom implementation of IFieldTypeFactoryStore might not be applied when the edge endpoint is used.
The issue can occur when a custom Sitecore field type is queried through the Edge Preview endpoint. In this case, the field might fail to resolve and return an error similar to the following:
GraphQL.ExecutionError: Error trying to resolve [field]. ---> System.InvalidOperationException: Cannot check for interface type because TypeMapper never got initialized.
This behavior occurs because the Edge Preview endpoint is designed to stay compatible with the actual Experience Edge delivery endpoint. Extending the mirrored schema can make Preview behavior different from Experience Edge behavior.
To avoid compatibility issues, do not customize the mirrored Edge Preview schema directly.
If custom field type mapping is required and Sitecore Experience Edge for XM is not used, a separate Sitecore GraphQL endpoint can be configured instead of using the edge endpoint. The custom endpoint can be based on the standard content or systemContent schema provider, depending on the project configuration. For more information about creating and extending GraphQL schemas, see the Sitecore documentation.
Note: Customizing the Edge Preview schema directly is not supported because it can make Preview behavior differ from the Experience Edge delivery endpoint.