mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
filter that only the rooms of the current user are returned
This commit is contained in:
parent
fc50d69bff
commit
a51f357357
@ -406,6 +406,7 @@ export default shield(
|
||||
queryLocations: isAuthenticated,
|
||||
availableRoles: isAdmin,
|
||||
getInviteCode: isAuthenticated, // and inviteRegistration
|
||||
Room: isAuthenticated,
|
||||
},
|
||||
Mutation: {
|
||||
'*': deny,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { v4 as uuid } from 'uuid'
|
||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||
import Resolver from './helpers/Resolver'
|
||||
|
||||
export default {
|
||||
Query: {
|
||||
@ -45,4 +46,11 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
Room: {
|
||||
...Resolver('Room', {
|
||||
hasMany: {
|
||||
users: '<-[:CHATS_IN]-(related:User)',
|
||||
}
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
input _RoomFilter {
|
||||
AND: [_RoomFilter!]
|
||||
OR: [_RoomFilter!]
|
||||
users: _UserFilter
|
||||
users_in: [_UserFilter!]
|
||||
users_some: [_UserFilter!]
|
||||
users_some: _UserFilter
|
||||
}
|
||||
|
||||
type Room {
|
||||
@ -11,7 +9,7 @@ type Room {
|
||||
createdAt: String
|
||||
updatedAt: String
|
||||
|
||||
users: [User!]! @relation(name: "CHATS_IN", direction: "IN")
|
||||
users: [User]! @relation(name: "CHATS_IN", direction: "IN")
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user