mkai / dictionary-api

Dictionary API built with TypeGraphQL and TypeORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dictionary GraphQL API

Dictionary GraphQL API.

How to query

{
  lookup(input: { fromLanguage: "eng", toLanguage: "deu", searchString: "honey" }) {
    word {
      id
      text
      language {
        id
        code
      }
    }
    translatedWord {
      id
      text
      language {
        id
        code
      }
    }
  }
}

Result:

{
  "data": {
    "lookup": [
      {
        "word": {
          "id": "08620a66630843a6a6393072ea4d1937",
          "text": "honey",
          "language": {
            "id": "7647ebb0aed54f5bb70a9341f57ee319",
            "code": "eng"
          }
        },
        "translatedWord": {
          "id": "2aa10cdb69b642919cfb88a941a7c592",
          "text": "Honig {m}",
          "language": {
            "id": "fba6098fb4b84262a820eab5fedc35f8",
            "code": "deu"
          }
        }
      }
    ]
  }
}

Contributing

  1. Install the dependencies:

    npm install
  2. Set up the configuration:

    This project uses environment variables for configuration. Copy the example .env file to set up the defaults.

    cp .env.example .env

    Then, take a look at the file and add or edit the values according to your local environment.

  3. Run the development server:

    npm run dev

About

Dictionary API built with TypeGraphQL and TypeORM


Languages

Language:TypeScript 99.0%Language:Shell 1.0%