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
74 lines
1.3 KiB
TypeScript
74 lines
1.3 KiB
TypeScript
import { gql } from 'apollo-server-express'
|
|
|
|
export const basicProjectFieldsFragment = gql`
|
|
fragment BasicProjectFields on Project {
|
|
id
|
|
name
|
|
description
|
|
visibility
|
|
allowPublicComments
|
|
role
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
`
|
|
|
|
export const adminProjectListQuery = gql`
|
|
query AdminProjectList(
|
|
$query: String
|
|
$orderBy: String
|
|
$visibility: String
|
|
$limit: Int! = 25
|
|
$cursor: String = null
|
|
) {
|
|
admin {
|
|
projectList(
|
|
query: $query
|
|
orderBy: $orderBy
|
|
visibility: $visibility
|
|
limit: $limit
|
|
cursor: $cursor
|
|
) {
|
|
cursor
|
|
totalCount
|
|
items {
|
|
...BasicProjectFields
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectFieldsFragment}
|
|
`
|
|
|
|
export const getProjectObjectQuery = gql`
|
|
query GetProjectObject($projectId: String!, $objectId: String!) {
|
|
project(id: $projectId) {
|
|
object(id: $objectId) {
|
|
id
|
|
createdAt
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const createProjectMutation = gql`
|
|
mutation CreateProject($input: ProjectCreateInput!) {
|
|
projectMutations {
|
|
create(input: $input) {
|
|
...BasicProjectFields
|
|
}
|
|
}
|
|
}
|
|
|
|
${basicProjectFieldsFragment}
|
|
`
|
|
|
|
export const batchDeleteProjectsMutation = gql`
|
|
mutation BatchDeleteProjects($ids: [String!]!) {
|
|
projectMutations {
|
|
batchDelete(ids: $ids)
|
|
}
|
|
}
|
|
`
|