victorzidaroiu / tradespeople-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tradespeople Jobs API

Requirements

  • NodeJs 14.10

Setup

  • Run npm i (The local DB is created post install)
  • Run npm run start:dev

GraphiQL

Notes

  • For this exercise I am using Sqlite for convenience with the DB stored in a local file. In a production env, the app would use a managed DB service.
  • Linting is done via Airbnb's rules have a dependency on several eslint packages.

Usage examples

  mutation {
    addTradesperson(input:{ name: "Joe", longitude: 100, latitude: 100 }) {
      success
      tradespersonId
    }
  }
  mutation {
    addJob(input:{  description: "Job description", longitude: 101, latitude: 101, maxTradespersonDistance: 100 }) {
      success,
      jobId
    }
  }
  query {
    findJobsInRange(tradespersonId: 1) {
      success,
      jobs {
        description,
        latitude,
        longitude
      }
    }
  }

About


Languages

Language:JavaScript 100.0%