/ts-graphql

Primary LanguageTypeScript

TS GraphQL

cp .env.example .env

# fill `.env` with your `MONGODB_URI`

npm install

npm run start:dev

Mutations

mutation CreateProduct($input: NewProductInput!) {
  product: createProduct(createProductData: $input) {
    _id
    name
    price
    createdAt
    updatedAt
    active
  }
}
{
 "input": {
   "name": "New Product",
   "price": 100
 }
}

Queries

query{
  getProduct(id: "<OBJECT_ID>") {
    _id
    name
    price
    createdAt
    updatedAt
    active
  }
}