Created
July 17, 2018 01:09
-
-
Save mwarger/14fb61e366f267307c906f52ea0c461e to your computer and use it in GitHub Desktop.
Games and Reviews Schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input CreateGameInput { | |
id: ID! | |
title: String! | |
description: String | |
rating: Int | |
} | |
input CreateReviewInput { | |
id: ID! | |
rating: Int! | |
author: String | |
gameId: ID! | |
} | |
input DeleteGameInput { | |
id: ID! | |
} | |
input DeleteReviewInput { | |
id: ID! | |
} | |
type Game { | |
id: ID! | |
title: String! | |
description: String | |
rating: Int | |
@deprecated(reason: "Use Review instead") | |
reviews: [Review!] | |
} | |
type GameConnection { | |
items: [Game] | |
nextToken: String | |
} | |
type GameItem { | |
userId: ID! | |
gameId: ID! | |
content: String | |
attachment: String | |
createdAt: String | |
} | |
type Mutation { | |
createGame(input: CreateGameInput!): Game | |
updateGame(input: UpdateGameInput!): Game | |
deleteGame(input: DeleteGameInput!): Game | |
createReview(input: CreateReviewInput!): Review | |
updateReview(input: UpdateReviewInput!): Review | |
deleteReview(input: DeleteReviewInput!): Review | |
} | |
type Query { | |
getGames: [GameItem] | |
fetchGame(id: ID!): GameItem | |
getGame(id: ID!): Game | |
listGames(first: Int, after: String): GameConnection | |
getReview(id: ID!): Review | |
listReviews(first: Int, after: String): ReviewConnection | |
queryReviewsByGameId(gameId: ID!, first: Int, after: String): ReviewConnection | |
} | |
type Review { | |
id: ID! | |
rating: Int! | |
author: String | |
gameId: ID! | |
} | |
type ReviewConnection { | |
items: [Review] | |
nextToken: String | |
} | |
type Subscription { | |
onCreateGame( | |
id: ID, | |
title: String, | |
description: String, | |
rating: Int | |
): Game | |
@aws_subscribe(mutations: ["createGame"]) | |
onUpdateGame( | |
id: ID, | |
title: String, | |
description: String, | |
rating: Int | |
): Game | |
@aws_subscribe(mutations: ["updateGame"]) | |
onDeleteGame( | |
id: ID, | |
title: String, | |
description: String, | |
rating: Int | |
): Game | |
@aws_subscribe(mutations: ["deleteGame"]) | |
onCreateReview( | |
id: ID, | |
rating: Int, | |
author: String, | |
gameId: ID | |
): Review | |
@aws_subscribe(mutations: ["createReview"]) | |
onUpdateReview( | |
id: ID, | |
rating: Int, | |
author: String, | |
gameId: ID | |
): Review | |
@aws_subscribe(mutations: ["updateReview"]) | |
onDeleteReview( | |
id: ID, | |
rating: Int, | |
author: String, | |
gameId: ID | |
): Review | |
@aws_subscribe(mutations: ["deleteReview"]) | |
} | |
input UpdateGameInput { | |
id: ID! | |
title: String | |
description: String | |
rating: Int | |
} | |
input UpdateReviewInput { | |
id: ID! | |
rating: Int | |
author: String | |
gameId: ID | |
} | |
schema { | |
query: Query | |
mutation: Mutation | |
subscription: Subscription | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment