PluginProbe
WPGraphQL / 2.22.0
WPGraphQL v2.22.0
2.22.3 2.22.2 2.22.1 2.22.0 2.21.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.15.0 2.14.1 2.14.0 2.13.0 2.2.0 2.3.0 2.3.3 2.3.6 2.3.8 2.5.0 2.5.1 2.5.2 2.5.3 All 177 releases
wp-graphql / src / Type / ObjectType / UserRole.php

UserRole.php in WPGraphQL 2.22.0, at src/Type/ObjectType/UserRole.php

62 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPGraphQL\Type\ObjectType;
4
5 use WPGraphQL\Model\UserRole as UserRoleModel;
6
7 class UserRole {
8
9 /**
10 * Register the UserRole Type
11 *
12 * @return void
13 */
14 public static function register_type() {
15 register_graphql_object_type(
16 'UserRole',
17 [
18 'description' => static function () {
19 return __( 'A user role object', 'wp-graphql' );
20 },
21 'model' => UserRoleModel::class,
22 'interfaces' => [ 'Node' ],
23 'fields' => static function () {
24 return [
25 'id' => [
26 'description' => static function () {
27 return __( 'The globally unique identifier for the user role object.', 'wp-graphql' );
28 },
29 ],
30 'name' => [
31 'type' => 'String',
32 'description' => static function () {
33 return __( 'The registered name of the role', 'wp-graphql' );
34 },
35 ],
36 'capabilities' => [
37 'type' => [
38 'list_of' => 'String',
39 ],
40 'description' => static function () {
41 return __( 'The capabilities that belong to this role', 'wp-graphql' );
42 },
43 ],
44 'displayName' => [
45 'type' => 'String',
46 'description' => static function () {
47 return __( 'The display name of the role', 'wp-graphql' );
48 },
49 ],
50 'isRestricted' => [
51 'type' => 'Boolean',
52 'description' => static function () {
53 return __( 'Whether the object is restricted from the current viewer', 'wp-graphql' );
54 },
55 ],
56 ];
57 },
58 ]
59 );
60 }
61 }
62