0b2ca9a515
* WIP version create * commitCreate migrated * minor cleanup * commitReceived migrated * added Project.object * Project.comment introduced * moving away old API usages in FE1 * ProjectMutations.batchDelete * project pending access requests * WIP project access req tests * project access req tests done * ModelByName test * version mutation tests * project.object tests * batch delete tests * minor improvements to redirect logging
91 lines
1.9 KiB
TypeScript
91 lines
1.9 KiB
TypeScript
import { gql } from 'apollo-server-express'
|
|
|
|
const basicProjectAccessRequestFragment = gql`
|
|
fragment BasicProjectAccessRequestFields on ProjectAccessRequest {
|
|
id
|
|
requester {
|
|
id
|
|
name
|
|
}
|
|
requesterId
|
|
projectId
|
|
createdAt
|
|
}
|
|
`
|
|
|
|
export const createProjectAccessRequestMutation = gql`
|
|
mutation CreateProjectAccessRequest($projectId: String!) {
|
|
projectMutations {
|
|
accessRequestMutations {
|
|
create(projectId: $projectId) {
|
|
...BasicProjectAccessRequestFields
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectAccessRequestFragment}
|
|
`
|
|
|
|
export const getActiveUserProjectAccessRequestQuery = gql`
|
|
query GetActiveUserProjectAccessRequest($projectId: String!) {
|
|
activeUser {
|
|
projectAccessRequest(projectId: $projectId) {
|
|
...BasicProjectAccessRequestFields
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectAccessRequestFragment}
|
|
`
|
|
|
|
export const getActiveUserFullProjectAccessRequestQuery = gql`
|
|
query GetActiveUserFullProjectAccessRequest($projectId: String!) {
|
|
activeUser {
|
|
projectAccessRequest(projectId: $projectId) {
|
|
...BasicProjectAccessRequestFields
|
|
project {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectAccessRequestFragment}
|
|
`
|
|
|
|
export const getPendingProjectAccessRequestsQuery = gql`
|
|
query GetPendingProjectAccessRequests($projectId: String!) {
|
|
project(id: $projectId) {
|
|
id
|
|
name
|
|
pendingAccessRequests {
|
|
...BasicProjectAccessRequestFields
|
|
project {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectAccessRequestFragment}
|
|
`
|
|
|
|
export const useProjectAccessRequestMutation = gql`
|
|
mutation UseProjectAccessRequest(
|
|
$requestId: String!
|
|
$accept: Boolean!
|
|
$role: StreamRole! = STREAM_CONTRIBUTOR
|
|
) {
|
|
projectMutations {
|
|
accessRequestMutations {
|
|
use(requestId: $requestId, accept: $accept, role: $role) {
|
|
id
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|