Skip to content

Commit 35e49fc

Browse files
committed
- esc_html and update translators comment
1 parent 14a51b8 commit 35e49fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Registry/TypeRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,15 +948,15 @@ protected function prepare_field( string $field_name, array $field_config, strin
948948
$type = $this->get_type( $field_config['type'] );
949949
if ( ! $type ) {
950950
$message = sprintf(
951-
/* translators: %s is the Field name. */
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. */
952952
__( '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' ),
953953
$field_config['name'],
954954
$type_name,
955955
$field_config['type']
956956
);
957957
// 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,
958958
// but now it will have a more helpful error message.
959-
throw new Error( $message );
959+
throw new Error( esc_html( $message ) );
960960
}
961961
return $type;
962962
};

0 commit comments

Comments
 (0)