Skip to content

Commit

Permalink
chore(docs): mention typescript strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Sep 27, 2024
1 parent baa7452 commit fb3ffc3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
23 changes: 21 additions & 2 deletions website/content/guides/10_getting-started/20_generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions website/content/guides/20_methods/20_document.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# Document <GeneratedClientBadge />

<!-- @include: @/_snippets/example-links/document.md -->

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

<!-- @include: @/_snippets/examples/generated/document.md -->

0 comments on commit fb3ffc3

Please sign in to comment.