Files
cadhub/app/api/src/graphql/projects.sdl.ts
Kurt Hutten 219f341972 Kurt/rw 37 upgrade (#566)
* Update readme

* Upgrade redwood to 0.37.x
2021-10-20 14:10:19 +11:00

71 lines
1.5 KiB
TypeScript

export const schema = gql`
type Project {
id: String!
title: String!
description: String
code: String
mainImage: String
createdAt: DateTime!
updatedAt: DateTime!
user: User!
userId: String!
deleted: Boolean!
cadPackage: CadPackage!
socialCard: SocialCard
Comment: [Comment]!
Reaction(userId: String): [ProjectReaction]!
forkedFromId: String
forkedFrom: Project
childForks: [Project]!
}
enum CadPackage {
openscad
cadquery
jscad
}
type Query {
projects(userName: String): [Project!]! @skipAuth
project(id: String!): Project @skipAuth
projectByUserAndTitle(userName: String!, projectTitle: String!): Project
@skipAuth
}
input CreateProjectInput {
title: String
description: String
code: String
mainImage: String
userId: String!
cadPackage: CadPackage!
}
input ForkProjectInput {
userId: String!
forkedFromId: String
code: String
}
input UpdateProjectInput {
title: String
description: String
code: String
mainImage: String
userId: String
}
type Mutation {
createProject(input: CreateProjectInput!): Project! @requireAuth
forkProject(input: ForkProjectInput!): Project! @requireAuth
updateProject(id: String!, input: UpdateProjectInput!): Project!
@requireAuth
updateProjectImages(
id: String!
mainImage64: String
socialCard64: String
): Project! @requireAuth
deleteProject(id: String!): Project! @requireAuth
}
`