Skip to content

Commit

Permalink
Merge pull request #1 from jorgeramirezamora/field-deprecation
Browse files Browse the repository at this point in the history
Field deprecation
  • Loading branch information
jorgeramirezamora authored Aug 2, 2022
2 parents 074e98e + 2e04a50 commit dc1542e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ const resolvers = {
}
},
},
Module: {
durationInSeconds: ({ length }) => length,
},
Track: {
author: ({ authorId }, _, { dataSources }) => {
return dataSources.trackAPI.getAuthor(authorId);
},

durationInSeconds: ({ length }) => length,

modules: ({ id }, _, { dataSources }) => {
return dataSources.trackAPI.getTrackModules(id);
Expand Down
12 changes: 8 additions & 4 deletions src/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ const typeDefs = gql`
author: Author!
"The track's illustration to display in track card or track page detail"
thumbnail: String
"The track's approximate length to complete, in minutes"
length: Int
"The track's approximate length to complete, in seconds"
length: Int @deprecated(reason: "Use durationInSeconds")
"The track's full duration, in seconds"
durationInSeconds: Int
"The number of modules this track contains"
modulesCount: Int
"The track's complete description, can be in markdown format"
Expand All @@ -61,8 +63,10 @@ const typeDefs = gql`
id: ID!
"The module's title"
title: String!
"The module's length in minutes"
length: Int
"The module's length in seconds"
length: Int @deprecated(reason: "Use durationInSeconds")
"The module's video duration, in seconds"
durationInSeconds: Int
"The module's text-based description, can be in markdown format. In case of a video, it will be the enriched transcript"
content: String
"The module's video url, for video-based modules"
Expand Down

0 comments on commit dc1542e

Please sign in to comment.