Skip to content

Commit

Permalink
Added the group and groupId arguments to the users GraphQL query.
Browse files Browse the repository at this point in the history
Resolved #5374
  • Loading branch information
andris-sevcenko committed Dec 30, 2019
1 parent e3a1841 commit 1934c38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- Added support for plugin-supplied element exporters. ([#5090](https://github.com/craftcms/cms/issues/5090))
- Control panel pages can now implement Vue-based admin tables that support bulk actions, search, and pagination.
- Added the `_count` field to all Elements when using GraphQL that returns the total related elements for a field. ([#4847](https://github.com/craftcms/cms/issues/4847))
- It’s now possible to filter users by user groups when querying for them using GraphQL. ([#5374](https://github.com/craftcms/cms/issues/5374))
- Added `craft\assetpreviews\HtmlPreview`.
- Added `craft\assetpreviews\ImagePreview`.
- Added `craft\assetpreviews\NoPreview`.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Added new “View files uploaded by other users”, “Edit files uploaded by other users”, “Replace files uploaded by other users”, “Remove files uploaded by other users”, and “Edit images uploaded by other users” user permissions.
- Assets fields now have a “Show unpermitted files setting, which determines whether the field should show files that the user doesn’t have permission to view per the new “View files uploaded by other users” permission.
- It’s now possible to filter element query results by their related elements using relational fields’ element query params (e.g. `publisher(100)` rather than `relatedTo({targetElement: 100, field: 'publisher'})`). ([#5200](https://github.com/craftcms/cms/issues/5200))
- It’s now possible to filter users by user groups when querying for them using GraphQL. ([#5374](https://github.com/craftcms/cms/issues/5374))
- Added `craft\controllers\UsersController::actionSessionInfo()`. ([#5355](https://github.com/craftcms/cms/issues/5355))
- Added `craft\gql\types\Number`.
- Added the `Craft.ui.createDateRangePicker()` JavaScript method.
Expand Down
10 changes: 10 additions & 0 deletions src/gql/arguments/elements/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public static function getArguments(): array
'type' => Type::listOf(Type::string()),
'description' => 'Narrows the query results based on the users’ last names.'
],
'groupId' => [
'name' => 'groupId',
'type' => Type::listOf(QueryArgument::getType()),
'description' => 'Narrows the query results based on the user group the users belong to, per the groups’ IDs.'
],
'group' => [
'name' => 'group',
'type' => Type::listOf(QueryArgument::getType()),
'description' => 'Narrows the query results based on the user group the users belong to.'
],
]);
}

Expand Down

0 comments on commit 1934c38

Please sign in to comment.