GithubHelp home page GithubHelp logo

backend-quiz's Introduction

CarDash Backend Quiz

This is a basic quiz to to assess your familiarity with the technology stack we're using. If you are familiar with the tech stack, this should only take 30-45 minutes of your time. If not familiar, it could take longer.

To get started, clone this repository.

To get the app running, npm i and run npm run dev.

To test your work, run npm run test

The Tasks

  1. Create a new query to fetch an individual user by id
{
  user(id: 5) {
    firstName
  }
}

Bonus points for generalizing this to work across all of the models

  1. Create a new GraphQL property on User called displayName, which is defined as first name and last initial, e.g. Evan R.

  2. Create a new query profitableUsers which returns a sorted list of users according to the total value of their orders.

{
  profitableUsers(top: 5) {
    user {
      firstName
      lastName
    }
    spend
  }
}
  1. Create a new GraphQL mutation createVehicle that accepts parameters year, make, and model. This mutation throws an error if the (make, model) pair is not valid. You will want to fill out the function set in db.js, and you can find the list of valid pairs below.

  2. Create a new GraphQL mutation updateVehicle that accepts parameters id, year, make, and model. This mutation throws an error if the (make, model) pair is not valid. Otherwise it updates and saves the appropriate model. You will want to fill out the function set in db.js, and you can find the list of valid pairs below.

Valid pairs

const makes = {
  Acura: ['MDX', 'RDX', 'ILX'],
  Audi: ['A4', 'Q5', 'Q7'],
  BMW: ['325', '750'],
  Ford: ['Taurus', 'F150'],
  Honda: ['CR-V', 'Accord'],
  Jaguar: ['XJ', 'XF', 'XE'],
  Jeep: ['Grand Cherokee'],
  Toyota: ['RAV4', 'Corolla', 'Camry'],
}

backend-quiz's People

Contributors

emrosenf avatar knewter avatar

Watchers

 avatar  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.