Skip to content

LinHAO-1/radian-coding-assesment

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Use http://localhost:3000/graphql

in the root make a .env file and add the postgreSQL database url

Queries to use

getAllCars

{
  "query": "query { getAllCars { id make model year color } }"
}

getCarByMake (This will retrieve for example, all Toyotas)

{
  "query": "query { getCarsByMake(make: \"Toyota\") { id make model year color } }"
}

groupCarsByMake (This will return all cars but group them by make)

{
  "query": "{ groupCarsByMake { make items { id model year color } } }"
}

addCar

{
  "query": "mutation AddCar($carInput: CarInput!) { addCar(carInput: $carInput) { id make model year color } }",
  "variables": {
    "carInput": {
      "make": "Toyota",
      "model": "Camry",
      "year": 2020,
      "color": "Blue"
    }
  }
}

addCars(This will add a list of cars)

{
  "query": "mutation AddCars($carInputs: [CarInput!]!) { addCars(carInputs: $carInputs) { id make model year color } }",
  "variables": {
    "carInputs": [
      {
        "make": "Honda",
        "model": "Civic",
        "year": 2021,
        "color": "Red"
      },
      {
        "make": "Ford",
        "model": "Mustang",
        "year": 2019,
        "color": "Yellow"
      }
    ]
  }
}

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published