Uploading the Repo
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
const { gql } = require("apollo-server");
|
||||
|
||||
const typeDefs = gql`
|
||||
type MainCard {
|
||||
title: String!
|
||||
image: String!
|
||||
}
|
||||
type Animal {
|
||||
id: ID!
|
||||
image: String!
|
||||
title: String!
|
||||
rating: Float
|
||||
price: String!
|
||||
description: [String]!
|
||||
slug: String!
|
||||
stock: Int!
|
||||
onSale: Boolean
|
||||
category: Category
|
||||
}
|
||||
type Category {
|
||||
id: ID!
|
||||
image: String!
|
||||
category: String!
|
||||
slug: String!
|
||||
animals: [Animal!]!
|
||||
}
|
||||
type Query {
|
||||
mainCards: [MainCard]
|
||||
animals: [Animal!]!
|
||||
animal(slug: String!): Animal
|
||||
categories: [Category!]!
|
||||
category(slug: String!): Category
|
||||
}
|
||||
type Mutation {
|
||||
addAnimal(
|
||||
image: String!
|
||||
title: String!
|
||||
rating: Float
|
||||
price: String!
|
||||
description: [String]!
|
||||
slug: String!
|
||||
stock: Int!
|
||||
onSale: Boolean
|
||||
category: String
|
||||
): Animal
|
||||
removeAnimal(id: ID!): Boolean
|
||||
}
|
||||
`;
|
||||
|
||||
module.exports = { typeDefs };
|
||||
Reference in New Issue
Block a user