generated from pascalmartineau/wp-skeleton
refactor: use onServerResponse for auth instead of server api
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user