implement room order

This commit is contained in:
Ulf Gebhardt 2023-07-15 12:51:33 +02:00
parent 66cd66d71a
commit 661c2f1b71
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 10 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export const createRoomMutation = () => {
export const roomQuery = () => { export const roomQuery = () => {
return gql` return gql`
query Room($first: Int, $offset: Int, $id: ID) { query Room($first: Int, $offset: Int, $id: ID) {
Room(first: $first, offset: $offset, id: $id) { Room(first: $first, offset: $offset, id: $id, orderBy: createdAt_desc) {
id id
roomId roomId
roomName roomName

View File

@ -5,6 +5,11 @@
# users_some: _UserFilter # users_some: _UserFilter
# } # }
# TODO change this to last message date
enum _RoomOrdering {
createdAt_desc
}
type Room { type Room {
id: ID! id: ID!
createdAt: String createdAt: String
@ -24,5 +29,8 @@ type Mutation {
} }
type Query { type Query {
Room(id: ID): [Room] Room(
id: ID
orderBy: [_RoomOrdering]
): [Room]
} }