diff --git a/graphql/odyssey-lift-off/server/src/schema.js b/graphql/odyssey-lift-off/server/src/schema.js index 49e04ec30..adf2672cf 100644 --- a/graphql/odyssey-lift-off/server/src/schema.js +++ b/graphql/odyssey-lift-off/server/src/schema.js @@ -10,6 +10,10 @@ const typeDefs = gql` module(id: ID!): Module! } + type Mutation { + incrementTrackViews(id: ID!): IncrementTrackViewsResponse! + } + "A track is a group of Modules that teaches about a specific topic" type Track { id: ID! @@ -52,6 +56,17 @@ const typeDefs = gql` "The module's video url, for video-based modules" videoUrl: String } + + type IncrementTrackViewsResponse { + "Similar to HTTP status code, represents the status of the mutation" + code: Int! + "Indicates whether the mutation was successful" + success: Boolean! + "Human-readable message for the UI" + message: String! + "Newly updated track after a successful mutation" + track: Track + } `; module.exports = typeDefs;