Skip to content

Commit

Permalink
Merge pull request #964 from bakaphp/KA-123
Browse files Browse the repository at this point in the history
refactor: add order
  • Loading branch information
kaioken committed Feb 21, 2024
2 parents 28132b2 + ed2f20c commit bc709b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion graphql/schemas/Ecosystem/Admin/app.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ extend type Query @guard {
}

extend type Query {
getAppSettings(key: String! @eq): AppSettings
getAppSettings(
key: String! @eq,
orderBy: _@orderBy(columns: ["created_at", "updated_at", "id", "name"])
): AppSettings
@field(
resolver: "App\\GraphQL\\Ecosystem\\Queries\\Apps\\AppsListQuery@getAppSettings"
)
Expand Down
1 change: 1 addition & 0 deletions graphql/schemas/Ecosystem/company.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ extend type Query @guard {
"updated_at"
]
)
orderBy: _@orderBy(columns: ["created_at", "updated_at", "id", "name"])
): [User!]!
@paginate(
builder: "App\\GraphQL\\Ecosystem\\Queries\\Companies\\UserManagementQuery@getAllCompanyUsers"
Expand Down
4 changes: 3 additions & 1 deletion tests/GraphQL/Ecosystem/Companies/CompanyUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function testGetCompanyUsers()
$response = $this->graphQL( /** @lang GraphQL */
'
{
companyUsers() {
companyUsers(
orderBy: [{ field: "id", order: DESC }]
) {
data {
id,
Expand Down

0 comments on commit bc709b2

Please sign in to comment.