75 lines
1.5 KiB
GraphQL
75 lines
1.5 KiB
GraphQL
extend type Query {
|
|
stream( id: String! ): Stream
|
|
"""
|
|
All the streams of the current user, pass in the `query` parameter to seach by name, description or ID.
|
|
"""
|
|
streams( query: String!, limit: Int! = 25, cursor: String ): StreamCollection
|
|
}
|
|
|
|
type Stream {
|
|
id: String!
|
|
name: String!
|
|
description: String
|
|
isPublic: Boolean!
|
|
createdAt: String!
|
|
updatedAt: String!
|
|
collaborators: [ StreamCollaborator ]!
|
|
}
|
|
|
|
extend type User {
|
|
"""
|
|
All the streams that a user has access to.
|
|
"""
|
|
streams( limit: Int! = 25, cursor: String ): StreamCollection
|
|
}
|
|
|
|
type StreamCollaborator {
|
|
id: String!
|
|
name: String!
|
|
role: String!
|
|
}
|
|
|
|
type StreamCollection {
|
|
totalCount: Int!
|
|
cursor: String
|
|
items: [ Stream ]
|
|
}
|
|
|
|
|
|
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 a user on a given stream.
|
|
"""
|
|
streamGrantPermission( streamId: String!, userId: String!, role: String! ): Boolean
|
|
"""
|
|
Revokes the permissions of a 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
|
|
}
|