extend type Stream { commits( limit: Int! = 25, cursor: String ): CommitCollection commit( id: String! ): Commit branches( limit: Int! = 25, cursor: String ): BranchCollection branch( name: String! ): Branch } extend type User { commits( limit: Int! = 25, cursor: String ): CommitCollectionUser } type Branch { id: String! name: String! author: User! description: String! commits( limit: Int! = 25, cursor: String ): CommitCollection } type Commit { id: String! referencedObject: String! realObject: Object message: String authorName: String authorId: String createdAt: String } type CommitCollectionUserNode { id: String! referencedObject: String! realObject: Object message: String streamId: String streamName: String } type BranchCollection { totalCount: Int! cursor: String items: [Branch] } type CommitCollection { totalCount: Int! cursor: String items: [Commit] } type CommitCollectionUser { totalCount: Int! cursor: String items: [CommitCollectionUserNode] } extend type Mutation { branchCreate( branch: BranchCreateInput! ): String! @hasRole(role: "server:user") @hasScope(scope: "streams:write") branchUpdate( branch: BranchUpdateInput! ): Boolean! @hasRole(role: "server:user") @hasScope(scope: "streams:write") branchDelete( branch: BranchDeleteInput! ): Boolean! @hasRole(role: "server:user") @hasScope(scope: "streams:write") commitCreate( commit: CommitCreateInput! ): String! @hasRole(role: "server:user") @hasScope(scope: "streams:write") commitUpdate( commit: CommitUpdateInput! ): Boolean! @hasRole(role: "server:user") @hasScope(scope: "streams:write") commitDelete( commit: CommitDeleteInput! ): Boolean! @hasRole(role: "server:user") @hasScope(scope: "streams:write") } extend type Subscription { # TODO: auth for these subscriptions """ Subscribe to branch created event """ branchCreated( streamId: String! ): JSONObject @hasRole(role: "server:user") """ Subscribe to branch updated event. """ branchUpdated( streamId: String!, branchId: String ): JSONObject @hasRole(role: "server:user") """ Subscribe to branch deleted event """ branchDeleted( streamId: String! ): JSONObject @hasRole(role: "server:user") """ Subscribe to commit created event """ commitCreated( streamId: String! ): JSONObject @hasRole(role: "server:user") """ Subscribe to commit updated event. """ commitUpdated( streamId: String!, commitId: String ): JSONObject @hasRole(role: "server:user") """ Subscribe to commit deleted event """ commitDeleted( streamId: String! ): JSONObject @hasRole(role: "server:user") } input BranchCreateInput { streamId: String! name: String! description: String } input BranchUpdateInput { streamId: String! id: String! name: String description: String } input BranchDeleteInput { streamId: String! id: String! } input CommitCreateInput { streamId: String! branchName: String! objectId: String! message: String previousCommitIds: [String] } input CommitUpdateInput { streamId: String! id: String! message: String! } input CommitDeleteInput { streamId: String! id: String! }