Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Sep 14, 2023
1 parent 9c27e72 commit 9aae77b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/source/development-testing/static-typing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema: '<URL_OF_YOUR_GRAPHQL_API>',
documents: ['src/**/*.tsx'],
// this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure
documents: ['src/**/*.{ts,tsx}'],
generates: {
'./src/__generated__/': {
preset: 'client',
Expand All @@ -44,8 +45,6 @@ export default config;

> There are multiple ways to [specify a schema](https://www.the-guild.dev/graphql/codegen/docs/config-reference/schema-field#root-level) in your `codegen.ts`, so pick whichever way works best for your project setup.
> Your `documents` might exist in directories other than `src` and may include `ts` files, please adjust accordingly. To catch everything, consider implementing: `documents: ['**/*.{ts,tsx}']`.
Finally, we'll add the following scripts to our `package.json` file:

```json title="package.json"
Expand Down

0 comments on commit 9aae77b

Please sign in to comment.