November 2019
Beginner
804 pages
20h 1m
English
Now we can finally complete the implementation of our GraphQL resolver for songs.
This resolver will be responsible for fetching and returning Song objects. To do so, it'll make use of MusicService, which is already available in the project. We have simply ported the existing code.
Create then open the backend/src/song/song.resolver.ts file and adapt it as follows:
import { Args, Query, Resolver } from '@nestjs/graphql';
import { MusicService } from '../musixmatch/services';
import { Inject } from '@nestjs/common';
import { TYPES } from '../musixmatch/ioc/types';
import { SongDto } from './song.dto';
import { Observable } from 'rxjs';
@Resolver('Song') export class SongResolver { ...Read now
Unlock full access