From fb3ffc31bff5dc3aaf4982b1a0dc7072953c5a3e Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Fri, 27 Sep 2024 08:52:06 -0400 Subject: [PATCH] chore(docs): mention typescript strict mode --- .../guides/10_getting-started/20_generated.md | 23 +++++++++++++++++-- .../content/guides/20_methods/20_document.md | 13 +++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/website/content/guides/10_getting-started/20_generated.md b/website/content/guides/10_getting-started/20_generated.md index b778b8171..d400a7f6c 100644 --- a/website/content/guides/10_getting-started/20_generated.md +++ b/website/content/guides/10_getting-started/20_generated.md @@ -14,10 +14,29 @@ If you don't already have a project, create one: pnpm init ``` -Install dependencies. Graffle has a peer dependency on `graphql` so you will need to install that too. To easily run TypeScript we'll install `tsx`. +Install dependencies. Graffle has a peer dependency on `graphql` so you will need to install that too. ```sh -pnpm add graffle graphql tsx +pnpm add graffle graphql +``` + +### And TypeScript + +This will be a TypeScript project so we'll install some dependencies for that. + +```sh +pnpm add typescript tsx @tsconfig/strictest +``` + +- [`tsx`](https://github.com/privatenumber/tsx) makes it to easy run TypeScript files. +- [`@tsconfig/strictest`](https://github.com/tsconfig/bases/blob/main/bases/strictest.json) is optional but makes sure we have a good default settings. + +Make sure you have TypeScript strict mode enabled. For example: + +```json tsconfig.json +{ + "extends": "@tsconfig/strictest/tsconfig.json" +} ``` ## Generate Client diff --git a/website/content/guides/20_methods/20_document.md b/website/content/guides/20_methods/20_document.md index df415ef7d..be28e0b09 100644 --- a/website/content/guides/20_methods/20_document.md +++ b/website/content/guides/20_methods/20_document.md @@ -1 +1,14 @@ # Document + + + +The `document` method is used to create whole GraphQL documents. + +There are other more targeted ways of sending GraphQL requests when you don't need to author the entire document. + +- If you only need to work with a _single operation type_ then use [`$batch`](./40_batch.md). +- If you only need to work with a _single root field_ then use [root field methods]('./30_root-fields.md'). + +## Example + +