Replace the Schema validation function with the possibility to pass a GraphQL Schema Definition Language string to createTypes in Gatsby's onSchemaCustomization.
An example of when this can happen is if a relation is deleted in Payload - instead of an object, an id string is returned. If other articles in the collection have objects on that field, Gatsby will struggle to infer types.
Schema validation excluded entities which didn't pass this validation. This was always a quick fix to get the build working again - it makes more sense to explicitly define types for Gatsby.
Replace the Schema validation function with the possibility to pass a GraphQL Schema Definition Language string to
createTypes
in Gatsby'sonSchemaCustomization
.Details
Schema validation introduced in https://github.com/thompsonsj/gatbsy-source-payload-cms/pull/8 was a way of avoiding build errors caused by Gatsby being unable to infer types.
An example of when this can happen is if a relation is deleted in Payload - instead of an object, an id string is returned. If other articles in the collection have objects on that field, Gatsby will struggle to infer types.
Schema validation excluded entities which didn't pass this validation. This was always a quick fix to get the build working again - it makes more sense to explicitly define types for Gatsby.