19. Putting it all together
1m

You did it!

The MVP for our Catstronauts backend is up and running!

Let's revisit our UI mockups and check that all the operations the client needs will work with our server.

Home page

Get all tracks:

query GetTracksForHomepage {
tracksForHome {
id
title
thumbnail
length
modulesCount
author {
name
photo
}
}
}

Track details page

Get details for a single track:

query GetTrackDetails($trackId: ID!) {
track(id: $trackId) {
id
title
author {
id
name
photo
}
thumbnail
length
modulesCount
numberOfViews
numberOfLikes
modules {
id
title
length
}
description
}
}

Increment number of likes:

mutation LikeTrack($trackId: ID!) {
likeTrack(trackId: $trackId) {
success
track {
id
numberOfLikes
}
}
}

Increment number of views:

mutation IncrementTrackViewsMutation($incrementTrackViewsId: ID!) {
incrementTrackViews(id: $incrementTrackViewsId) {
code
success
message
track {
id
numberOfViews
}
}
}

Module details page

Get details for a single module, and get all modules for a track

query GetModuleAndParentTrack($moduleId: ID!, $trackId: ID!) {
module(id: $moduleId) {
id
title
content
videoUrl
}
track(id: $trackId) {
id
title
modules {
id
title
length
}
}
}
Previous
Next