Skip to content

Commit

Permalink
feat: add Adding a mutation to our schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mdssjc committed Mar 13, 2023
1 parent bf1a880 commit b26bb4e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions graphql/odyssey-lift-off/server/src/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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;

0 comments on commit b26bb4e

Please sign in to comment.