Next, we want our GraphQL API to also support finding artists and loading song lyrics. Let's proceed with the creation of their respective modules and GraphQL resolvers.
Execute the following commands from the backend folder:
- npx @nestjs/cli g mo artist
- npx @nestjs/cli g r artist
- npx @nestjs/cli g mo song-lyrics
- npx @nestjs/cli g r song-lyrics
Notice the shorthand versions for module (that is, mo) and for resolver (that is, r).
Next, we have to create the DTOs for artists and song lyrics. As we did for song before, we'll add a field for each property declared in backend/src/musixmatch/domain/artist.ts and backend/src/musixmatch/domain/song-lyrics.ts. Since our MusicService class will return objects based on those classes, we have to be sure that our DTOs contain the same fields. On a real project, you would need...