From b72485a245fea878ef36f810a8f7ad0e35b2a88e Mon Sep 17 00:00:00 2001 From: Samuel Torres <33882985+torressam333@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:29:00 -0700 Subject: [PATCH] chore: update documentation to include install commands for typescript (#7691) --- packages/server/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/server/README.md b/packages/server/README.md index ccf2c185c49..74f7d54064e 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -92,6 +92,12 @@ First, install Apollo Server, the JavaScript implementation of the core GraphQL npm install @apollo/server graphql express cors body-parser ``` +If using Typescript you may also need to install additional type declaration packages as development dependencies to avoid common errors when importing the above packages (i.e. Could not find a declaration file for module '`cors`'): + +``` +npm install --save-dev @types/cors @types/express @types/body-parser +``` + Then, write the following to `server.mjs`. (By using the `.mjs` extension, Node lets you use the `await` keyword at the top level.) ```js