This is a sample server implementation to store/retrieve songs using GraphQL with Apollo.
cd apollo-server
andnpm install
npm start
Start the server & access the GraphQL Playground IDE, e.g. on localhost:4000
.
To query songs:
query {
songs {
id
title
keysPlayed
}
}
To add a song:
mutation {
addSong(title: "Some new song", keysPlayed: ["D", "E", "F"]) {
title
keysPlayed
}
}