You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$field_config['type'] = function () use ( $field_config ) {
947
-
return$this->get_type( $field_config['type'] );
947
+
$field_config['type'] = function () use ( $field_config, $type_name ) {
948
+
$type = $this->get_type( $field_config['type'] );
949
+
if ( ! $type ) {
950
+
$message = sprintf(
951
+
/* translators: %1$s is the Field name, %2$s is the type name the field belongs to. %3$s is the non-existent type name being referenced. */
952
+
__( 'The field \'%1$s\' on Type \'%2$s\' is configured to return \'%3$s\' which is a non-existent Type in the Schema. Make sure to define a valid type for all fields. This might occur if there was a typo with \'%3$s\', or it needs to be registered to the Schema.', 'wp-graphql' ),
953
+
$field_config['name'],
954
+
$type_name,
955
+
$field_config['type']
956
+
);
957
+
// We throw an error here instead of graphql_debug message, as an error would already be thrown if a type didn't exist at this point,
958
+
// but now it will have a more helpful error message.
0 commit comments