-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
status: actionableReady for work to beginReady for work to begintype: enhancementImprovements to existing functionalityImprovements to existing functionality
Description
Description
When a field references a GraphQL Type that does not exist, the error returned when the schema fails to load isn't clear on what the problem is or how to fix it.
Steps to reproduce
- register a mutation like so:
<?php
add_action( 'graphql_register_types', function() {
register_graphql_mutation( 'testMutation', [
'inputFields' => [ 'test' => [ 'type' => 'String' ] ],
'outputFields' => [ 'test' => [ 'type' => 'NonExistantType' ] ],
'mutateAndGetPayload' => function( $input, $context, $info ) { return true; }
] );
} );
?>- Open the GraphiQL IDE and see the schema fails to load
- Inspect the network response
- See the "Internal Server Error" without a whole lot of information to help debug
Expectation
I would expect the "Internal Server Error" to mention something explicit like "NonExistantType" referenced on the "TestMutationPayload.answer" field is not a registered Type in the Schema. Or something along those lines. 🤔
Additional context
No response
WPGraphQL Version
1.20.0
WordPress Version
latest
PHP Version
8..2
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have disabled ALL plugins except for WPGraphQL.
- Yes
- My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
Metadata
Metadata
Assignees
Labels
status: actionableReady for work to beginReady for work to begintype: enhancementImprovements to existing functionalityImprovements to existing functionality
Type
Projects
Status
✅ Done