Skip to content

Latest commit

 

History

History
81 lines (65 loc) · 1.06 KB

README.md

File metadata and controls

81 lines (65 loc) · 1.06 KB

Description

GraphQL backend service using NestJS & Typescript

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

DB

  Dummy data:
    Books: ./src/mocks/books.mock.ts
    Libraries: ./src/mocks/libraries.mock.ts

Search books by title (case-sensitive) and Get all books without using "search" argument

query {
  books(search: "book") {
    id,
    title,
    createdDate,
    library {
      id,
      title
    }
  }
}


query {
  books {
    id,
    title,
    createdDate,
    library {
      id,
      title
    }
  }
}

Get total number of how many books added - starting from specific starting date

  query {
    count(startingDate: "06/07/2010")  
  }

GraphQL mutation that can change book title for specific book id

  mutation {
    update(input: { id: 1, title: "First Book" }) {
      id,
      title,
      createdDate,
      library {
        id, title
      }
    } 
  }