Skip to content

Commit

Permalink
- Make the fields hookable per code review request
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbahl committed Jan 28, 2020
1 parent d3a0409 commit 2907174
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ManageTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,19 @@ public static function add_user_mutation_input_fields() {
],
];

register_graphql_fields( 'RegisterUserInput', $fields );
register_graphql_fields( 'CreateUserInput', $fields );
register_graphql_fields( 'UpdateUserInput', $fields );

$mutations_to_add_fields_to = apply_filters('graphql_jwt_auth_add_user_mutation_input_fields', [
'RegisterUserInput',
'CreateUserInput',
'UpdateUserInput',
] );

if ( ! empty( $mutations_to_add_fields_to ) && is_array( $mutations_to_add_fields_to ) ) {
foreach ( $mutations_to_add_fields_to as $mutation ) {
register_graphql_fields( $mutation, $fields );
}
}

}

/**
Expand Down

0 comments on commit 2907174

Please sign in to comment.