refactor: use onServerResponse for auth instead of server api

This commit is contained in:
2025-09-18 10:23:09 -04:00
parent a661350e1c
commit c82abe88e4
11 changed files with 57 additions and 139 deletions

View File

@@ -78,26 +78,3 @@ function ccat_graphql_switch_to_mutation( $input ) {
'user' => \WPGraphQL::get_app_context()->get_loader( 'user' )->load_deferred( $target_user->ID ),
);
}
// Register userSwitchBack mutation
add_action( 'graphql_register_types', 'ccat_graphql_register_user_switch_back' );
function ccat_graphql_register_user_switch_back() {
register_graphql_mutation(
'userSwitchBack',
array(
'inputFields' => array(),
'outputFields' => array(
'success' => array(
'type' => 'Boolean',
'description' => esc_html__( 'Whether switching back was successful', 'ccat' ),
),
),
'mutateAndGetPayload' => 'ccat_graphql_switch_back_mutation',
)
);
}
// Callback for userSwitchBack mutation
function ccat_graphql_switch_back_mutation() {
return array( 'success' => true );
}