charlypoly / spotify-graphql

GraphQL schema for Spotify WebAPI — TypeScript / Node.js (v6)
MIT License
278 stars 27 forks source link
graphql spotify spotify-api spotify-graphql spotify-library spotify-playlist

Spotify GraphQL npm version https://david-dm.org/wittydeveloper/spotify-graphql TypeScript

GraphQL schema for Spotify Web API — TypeScript / Node.js (v6)


Try with the interactive console !

See spotify-graphql-examples for more examples



import SpotifyGraphQLClient from '../src/spotify-graphql';
import config from './config';

SpotifyGraphQLClient(config).query(`
  {
    track(id: "3W2ZcrRsInZbjWylOi6KhZ") {
      name
      artists {
        name
      }
    }
  }
`).then(result => {
  console.log(JSON.stringify(result));
});

// Print : 
// {
//   "data": {
//     "track": {
//       "name": "You & Me - Flume Remix",
//       "artists": [
//         {
//           "name": "Disclosure"
//         },
//         {
//           "name": "Eliza Doolittle"
//         },
//         {
//           "name": "Flume"
//         }
//       ]
//     }
//   }
// }

Queries

Albums