-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
45 lines (43 loc) · 951 Bytes
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export const typeDefs = `#graphql
type Game {
id: ID!
title: String!
platform: [String!]!
reviews: [Review!]
}
type Review {
id: ID!
rating: Int!
content: String!
game: Game!
author: Author!
}
type Author {
id: ID!
name: String!
verified: Boolean!
reviews: [Review!]
}
type Query{
reviews: [Review]
review(id: ID!): Review
games: [Game]
game(id: ID!): Game
authors: [Author]
author(id: ID!): Author
}
type Mutation{
deleteGame(id: ID!): [Game]
addGame(game: AddGameInput): Game
updateGame(id: ID!, edits: EditGameInput!): Game
}
input AddGameInput{
title: String!,
platform: [String!]!
}
input EditGameInput{
title: String,
platform: [String!]
}
`
// int, float, string, boolean, ID