GithubHelp home page GithubHelp logo

metamusic99's Introduction

MetaMusic

MetaMusic is a backend server using GraphQL API. GraphQL Logo

Features

  1. music: A user can query/mutate the music
  2. Only title, artist and year are mutable in a music.
  3. metaData: A user can add/remove metaData to/from music

Tech

  1. GraphQL.js
  2. ExpressJS
  3. DB (POSTGRES)

Testing Instruction

http://music-lib99.herokuapp.com/ Hosted App URL

Testing can be performed on http://music-lib99.herokuapp.com/graphql

Data-Type

music  {
    id: string
    title: string
    album: string
    artist: string
    year: number
    metaData: [{
        key: string,
        value: string
    }]
}
metaData {
    key: string
    value: string
}

Query Syntax

An example query on the above schema would be:

query{
  musics{
    id
    title
    album 
    artist
    year
    metaData {
        key
        value
    }
  }
}

A Query to Get a music

query{
    music(musicId:""){
        id
        title
        album 
        artist
        year
        metaData{
            key
            value
        }
    }
}

Properties responsed are variable according to request parameters.

A Query To mutate data is like

mutation{
    (MusicInput:{id:"m4",title:"music4",album:"album4",artist:"artist4",year: 2022,metaData:[{key:"k4",value:"v4"},{key:"k41",value:"k41"}]}){
        id
        title
        .
        .
    }
}

Queries for getting data ara musics: to gather all data & music(musicId:"id") to request a specific data point.

Queries for data mutation are

  1. addMusic to add music record to database.

  2. delMusic(muiscId:"") to delete a specific data record.

  3. UpdateTitle(musicId:"",title:""),UpdateArtist(musicId:"",atist:"")and UpdateYear(musicId:"",year:number for updating mutable records.

  4. For meta Data addMeta(musicId:"",key:"",value:"") for adding meta data to existing music record.

  5. rmMeta(musicId:"",key:"") for removing specific meta data record from music database.

For example queries (the demo data contains musicId strings from "m1" to "m4")

query{
    music(musicId:"m1")
    {
        id
        title
        album 
        artist
        year
        metaData{
            key
            value
        }
    }
}

This generates following response

{
  "data": {
    "music": {
      "id": "m1",
      "title": "Title_string",
      "album": "album_string",
      "artist": "Himesh",
      "year": 1869,
      "metaData": [
        {
          "key": "k1",
          "value": "v1"
        },
        {
          "key": "k2",
          "value": "v2"
        },
        {
          "key": "k3",
          "value": "v3"
        }
      ]
    }
  }
}

metamusic99's People

Contributors

pushkar1199 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.