graphql-spotify
Advanced tools
Comparing version 0.44.0 to 0.44.3
@@ -1009,15 +1009,19 @@ module.exports = | ||
Artist: { | ||
followerCount: async ({ id }) => { | ||
followerCount: async ({ id, followers }) => { | ||
if (followers) return followers.total; | ||
const artistFull = await ArtistsLoader.load(id); | ||
return artistFull.followers.total; | ||
}, | ||
images: async ({ id }) => { | ||
images: async ({ id, images }) => { | ||
if (images) return images; | ||
const artistFull = await ArtistsLoader.load(id); | ||
return artistFull.images; | ||
}, | ||
popularity: async ({ id }) => { | ||
popularity: async ({ id, popularity }) => { | ||
if (popularity) return popularity; | ||
const artistFull = await ArtistsLoader.load(id); | ||
return artistFull.popularity; | ||
}, | ||
genres: async ({ id }) => { | ||
genres: async ({ id, genres }) => { | ||
if (genres) return genres; | ||
const artistFull = await ArtistsLoader.load(id); | ||
@@ -1150,3 +1154,3 @@ return artistFull.genres; | ||
function serializeToURLParameters(obj) { | ||
return Object.entries(obj).map(([key, val]) => val && `${key}=${val}`).join('&'); | ||
return Object.entries(obj).map(([key, val]) => val && `${key}=${val}`).filter(i => i).join('&'); | ||
} | ||
@@ -1153,0 +1157,0 @@ |
{ | ||
"name": "graphql-spotify", | ||
"version": "0.44.0", | ||
"version": "0.44.3", | ||
"description": "GraphQL Schema And Resolvers For Spotify Web API", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib.js", |
@@ -1,2 +0,2 @@ | ||
## GraphQL Spotify: A [Spotify API](https://beta.developer.spotify.com/documentation/web-api/reference/) GraphQL Schema Implementation Built with [GraphQL.js](https://github.com/graphql/graphql-js) | ||
## GraphQL Spotify: [Spotify API](https://beta.developer.spotify.com/documentation/web-api/reference/) GraphQL Schema and Resolvers Built with [GraphQL.js](https://github.com/graphql/graphql-js) | ||
![](https://travis-ci.org/goldensunliu/graphql-spotify.svg?branch=master) | ||
@@ -3,0 +3,0 @@ [![npm version](https://badge.fury.io/js/graphql-spotify.svg)](https://badge.fury.io/js/graphql-spotify) |
@@ -176,15 +176,19 @@ import { | ||
Artist: { | ||
followerCount: async ({ id }) => { | ||
followerCount: async ({ id, followers }) => { | ||
if (followers) return followers.total | ||
const artistFull = await ArtistsLoader.load(id) | ||
return artistFull.followers.total | ||
}, | ||
images: async ({ id }) => { | ||
images: async ({ id, images }) => { | ||
if (images) return images | ||
const artistFull = await ArtistsLoader.load(id) | ||
return artistFull.images | ||
}, | ||
popularity: async ({ id }) => { | ||
popularity: async ({ id, popularity }) => { | ||
if (popularity) return popularity; | ||
const artistFull = await ArtistsLoader.load(id) | ||
return artistFull.popularity | ||
}, | ||
genres: async ({ id }) => { | ||
genres: async ({ id, genres }) => { | ||
if (genres) return genres; | ||
const artistFull = await ArtistsLoader.load(id) | ||
@@ -191,0 +195,0 @@ return artistFull.genres |
@@ -17,3 +17,5 @@ import 'isomorphic-fetch' | ||
function serializeToURLParameters(obj) { | ||
return Object.entries(obj).map(([key, val]) => val && `${key}=${val}`).join('&') | ||
return Object.entries(obj).map(([key, val]) => val && `${key}=${val}`) | ||
.filter((i)=> i) | ||
.join('&') | ||
} | ||
@@ -20,0 +22,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253124
32
2294