Skip to content

Latest commit

 

History

History

graphql-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

graphql-server

This is a simple server implementation to store/retrieve songs using GraphQL with Apollo.

Run the server

  • npm install
  • npm start

Linting

This repo contains a basic linting setup using eslint and prettier. You can setup your editor to show (and auto-fix on save) linting errors, e.g. using the VS Code ESLint extension.

You can also run:

  • npm run eslint to show linting errors
  • npm run eslint-fix to auto-fix linting errors

Run sample queries

Start the server & access the GraphQL Playground IDE, e.g. on localhost:4000.

IMPORTANT: This is just a sample API, you can modify it if needed.

To query songs:

query {
    songs {
        _id
        title
        keyStrokes
    }
}

To add a song:

mutation {
    addSong(title: "Some new song", keyStrokes: ["D", "E", "F"]) {
        _id
        title
        keyStrokes
    }
}