All Projects → goldensunliu → graphql-spotify

goldensunliu / graphql-spotify

Licence: MIT license
GraphQL Schema And Resolvers For Spotify Web API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to graphql-spotify

Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+5370.91%)
Mutual labels:  resolver, graphql-server, graphql-schema, dataloader
relay-compiler-plus
Custom relay compiler which supports persisted queries
Stars: ✭ 68 (+23.64%)
Mutual labels:  graphql-server, graphql-schema, graphql-js, graphql-tools
Typegql
Create GraphQL schema with TypeScript classes.
Stars: ✭ 415 (+654.55%)
Mutual labels:  graphql-server, graphql-schema, graphql-js
schemaglue
Naturally breaks down your monolithic graphql schema into bits and pieces and then glue them back together.
Stars: ✭ 117 (+112.73%)
Mutual labels:  resolver, graphql-schema, graphql-tools
Graphql Cost Analysis
A Graphql query cost analyzer.
Stars: ✭ 527 (+858.18%)
Mutual labels:  graphql-server, graphql-schema, graphql-js
Graphql Log
Add logging to your GraphQL resolvers so you know what's going on in your app.
Stars: ✭ 94 (+70.91%)
Mutual labels:  graphql-server, graphql-schema, graphql-js
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (+229.09%)
Mutual labels:  graphql-server, graphql-schema, graphql-js
graphql-express-nodejs
A Simple GraphQL Server implementation using Express and Node. See post here: https://t.co/Cm6GitZaBL
Stars: ✭ 24 (-56.36%)
Mutual labels:  graphql-server, graphql-schema, graphql-js
SpotifyWebApi
A .net core wrapper for the Spotify Web API
Stars: ✭ 19 (-65.45%)
Mutual labels:  spotify, spotify-api
spotipy2
The next generation Spotify Web API wrapper for Python 3.7+
Stars: ✭ 25 (-54.55%)
Mutual labels:  spotify, spotify-api
springtunes
Control your Spotify client remotely from your browser
Stars: ✭ 19 (-65.45%)
Mutual labels:  spotify, spotify-api
spotify-api-graphql-console
Spotify Web API GraphQL console.
Stars: ✭ 29 (-47.27%)
Mutual labels:  spotify, spotify-api
student-api-graphql
A GraphQL Wrapper for Ellucian's Banner Student REST API
Stars: ✭ 19 (-65.45%)
Mutual labels:  graphql-server, graphql-js
listentogether-hackathon
Grab some friends, connect your Spotify account, and listen to music in sync with each other.
Stars: ✭ 20 (-63.64%)
Mutual labels:  spotify, spotify-api
aw-watcher-spotify
Logs what you listen to on Spotify
Stars: ✭ 41 (-25.45%)
Mutual labels:  spotify, spotify-api
ugql
🚀GraphQL.js over HTTP with uWebSockets.js
Stars: ✭ 27 (-50.91%)
Mutual labels:  graphql-server, graphql-js
xspfy
Import XSPF playlists to Spotify.
Stars: ✭ 29 (-47.27%)
Mutual labels:  spotify, spotify-api
gqlc
GraphQL IDL Compiler
Stars: ✭ 23 (-58.18%)
Mutual labels:  graphql-schema, graphql-tools
graphql-modules-app
TypeScripted Apollo GraphQL Server using modules and a NextJS frontend utilising React modules with Apollo hooks. All bundled with a lot of dev friendly tools in a lerna setup..
Stars: ✭ 39 (-29.09%)
Mutual labels:  graphql-server, dataloader
graphql-compose-elasticsearch
Graphql App using Node with typescript, KOA framework and Elasticsearch
Stars: ✭ 40 (-27.27%)
Mutual labels:  graphql-schema, graphql-tools

GraphQL Spotify: Spotify API GraphQL Schema and Resolvers Built with GraphQL.js

npm version

Refer to src/schema/RootQuery.js for operations currently supported.


Blog on Why

Check out the blog on why graphql-spotify was built.

Demo

Deployed Example App Powered By GraphQL Spotify And Its Source Code Repo

Getting started

import { makeSchema } from "graphql-spotify"
let token;
//... somewhere the Spotify token is gotten from the context
const schema = makeSchema(token)
// pass the schema to your favorite server that accepts GraphQL.js Schemas

Make sure the token obtained has the correct scope, certain queries and mutations require different scopes from Spotify

Getting started with apollo-server-express

npm install --save graphql dataloader graphql-tools isomorphic-fetch body-parser apollo-server-express express graphql-spotify

ES6
import { makeSchema } from "graphql-spotify";
import { graphqlExpress, graphiqlExpress } from 'apollo-server-express';
import express from 'express';
import bodyParser from 'body-parser'
// Initialize the app
const port = parseInt(process.env.PORT, 10) || 3000
const app = express();
// bodyParser is needed just for POST.
app.use(
    '/graphql',
    bodyParser.json(),
    graphqlExpress(req => {
        let token;
        //... somewhere the spotify token is gotten from the context
        const schema = makeSchema(token)
        return { schema }
    }));
// GraphiQL, a visual editor for queries
app.use('/graphiql', graphiqlExpress({ endpointURL: '/graphql' }));
app.listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://localhost:${port}/graphql`)
})
ES5
const makeSchema = require("graphql-spotify").makeSchema;
const graphqlExpress = require('apollo-server-express').graphqlExpress;
const graphiqlExpress = require('apollo-server-express').graphiqlExpress;
const express = require('express');
const bodyParser = require('body-parser')
// Initialize the app
const port = parseInt(process.env.PORT, 10) || 3000
const app = express();
// bodyParser is needed just for POST.
app.use(
    '/graphql',
    bodyParser.json(),
    graphqlExpress(req => {
        let token;
        //... somewhere the spotify token is gotten from the context
        const schema = makeSchema(token)
        return { schema }
    }));
// GraphiQL, a visual editor for queries
app.use('/graphiql', graphiqlExpress({ endpointURL: '/graphql' }));
app.listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://localhost:${port}/graphql`)
})

Contribute

Anyone is welcome! Take a look at Roadmap.md for PR ideas and file some issues!

Used By

Created By

Sitian Liu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].