import { safeApiCall , paginatorFromVariables , syncedPoll } from '../utils' ; const poll = require ( 'when/poll' ) ; export function playlistResolvers ( spotifyApiClient ) { return { tracks ( playlist , variables ) { return syncedPoll ( 'Playlist.tracks' , ( ) => { return paginatorFromVariables ( 'OffsetPaging' , variables ) ( spotifyApiClient , 'getPlaylistTracks' , response => response . body . items , playlist . owner . id , playlist . id ) . then ( ( tracks ) => { return tracks ; } ) ; } , variables . throttle || 5 ) ; } } ; }