Giter Site home page Giter Site logo

company_tree_webprovise's Introduction

Setting up the .env file

This project uses environment variables to configure various settings. To set up the environment variables for this project, you will need to create a .env file in the root of the project directory.

An example .env.example file is provided in the root of the project directory. This file contains example values for all of the environment variables used by this project. To set up your .env file, follow these steps:

  1. Copy the .env.example file and rename it to .env.
  2. Open the .env file in a text editor.
  3. Replace the example values with your own values for each environment variable.
  4. Save and close the .env file.

Once you have completed these steps, your .env file will be set up and ready to use.

Running the project

After setting up the .env file, you can run the project by following these commands.

  • Run npm install to install the dependencies
  • Run npm run start:dev to run project This will start the development server and allow you to access the project at http://localhost:3000.

Integration Test for Nest.js GraphQL

This project uses nest.js, graphql, supertest-graphql and graphql-tag to set up and run integration tests for a graphql endpoint.

Prerequisites

Installation

  • Clone this repository and navigate to the project folder
  • Run npm install to install the dependencies
  • Run npm run test:int to run the integration test

Example GraphQL Query

Here is an example of a GraphQL query and its response:

query {
  company(id: "uuid-2") {
    id
    parentId
    cost
    createdAt
    children {
      id
      parentId
      name
      cost
      children {
        id
      }
    }
  }
}
{
  "data": {
    "company": [
      {
        "id": "uuid-2",
        "parentId": "uuid-1",
        "cost": 5199,
        "createdAt": "2021-02-25T10:35:32.978Z",
        "children": [
          {
            "id": "uuid-4",
            "parentId": "uuid-2",
            "name": "Price and Sons",
            "cost": 1340,
            "children": []
          },
          {
            "id": "uuid-7",
            "parentId": "uuid-2",
            "name": "Zieme - Mills",
            "cost": 1636,
            "children": []
          },
          {
            "id": "uuid-19",
            "parentId": "uuid-2",
            "name": "Schneider - Adams",
            "cost": 794,
            "children": []
          }
        ]
      }
    ]
  }
}

company_tree_webprovise's People

Contributors

minhhieple97 avatar

Watchers

 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.