4d6e899750
services for objects, branches, and commits; fixed some tests, scaffolded graphql api & resolvers
67 lines
1.3 KiB
GraphQL
67 lines
1.3 KiB
GraphQL
extend type Query {
|
|
stream(id: String!): Stream
|
|
}
|
|
|
|
type Stream {
|
|
id: String!
|
|
name: String!
|
|
description: String
|
|
isPublic: Boolean!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
users: [User]!
|
|
}
|
|
|
|
extend type User {
|
|
"""
|
|
All the streams that a user has access to.
|
|
"""
|
|
streams(offset: Int! = 0, limit: Int! = 100): StreamCollection
|
|
"""
|
|
The role this user has on a specific stream (can be populated when accessing a stream's users).
|
|
"""
|
|
role: String
|
|
}
|
|
|
|
type StreamCollection {
|
|
totalCount: Int!
|
|
streams: [Stream]
|
|
cursor: String
|
|
}
|
|
|
|
extend type Mutation {
|
|
"""
|
|
Creates a new stream.
|
|
"""
|
|
streamCreate( stream: StreamCreateInput! ): String
|
|
"""
|
|
Updates an existing stream.
|
|
"""
|
|
streamUpdate( stream: StreamUpdateInput! ): Boolean!
|
|
"""
|
|
Deletes an existing stream.
|
|
"""
|
|
streamDelete( id: String! ): Boolean!
|
|
"""
|
|
Grants permissions to an user on a given stream.
|
|
"""
|
|
streamGrantPermission( streamId: String!, userId: String!, role: String! ): Boolean
|
|
"""
|
|
Revokes the permissions of an user on a given stream.
|
|
"""
|
|
streamRevokePermission( streamId: String!, userId: String! ): Boolean
|
|
|
|
}
|
|
|
|
input StreamCreateInput {
|
|
name: String
|
|
description: String
|
|
isPublic: Boolean
|
|
}
|
|
|
|
input StreamUpdateInput {
|
|
id: String!
|
|
name: String
|
|
description: String
|
|
isPublic: Boolean
|
|
} |