1
0

Parts schema and scaffolld, with file uploading for the image (through Filestack)

This commit is contained in:
Ahmed Al-Taiar
2023-10-27 13:25:08 -04:00
parent 2f753308b1
commit 1eaf76fce2
31 changed files with 1492 additions and 13 deletions

View File

@@ -0,0 +1,35 @@
export const schema = gql`
type Part {
id: Int!
name: String!
description: String
availableStock: Int!
imageUrl: String!
createdAt: DateTime!
}
type Query {
parts: [Part!]! @requireAuth
part(id: Int!): Part @requireAuth
}
input CreatePartInput {
name: String!
description: String
availableStock: Int!
imageUrl: String!
}
input UpdatePartInput {
name: String
description: String
availableStock: Int
imageUrl: String
}
type Mutation {
createPart(input: CreatePartInput!): Part! @requireAuth
updatePart(id: Int!, input: UpdatePartInput!): Part! @requireAuth
deletePart(id: Int!): Part! @requireAuth
}
`