Skip to content

Commit

Permalink
chore: Update typegen example
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed May 24, 2022
1 parent 1c392e6 commit e84e69b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/using-graphql-typegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@

Example project for the documentation page [GraphQL Typegen](https://gatsbyjs.com/docs/how-to/local-development/graphql-typegen).

Run `npm install` and `npm run develop` to get started. If you have VSCode installed with the [GraphQL extension](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) you can get autocompletion inside VSCode itself for an query. You can access the global namespace `Queries` to type your query responses.
## Getting Started

Install dependencies:

```shell
npm install --legacy-peer-deps
```

Run the development server:

```shell
npm run develop
```

Afterwards you'll see new files at `src/gatsby-types.d.ts` and inside the `.cache/typegen` folder. You can now also run ESLint (with `npm run lint`). If you have VSCode installed with the [GraphQL extension](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) you can get autocompletion inside VSCode itself for an query (you'll need to run `gatsby develop` for this to work). You can access the global namespace `Queries` to type your query responses.
1 change: 1 addition & 0 deletions examples/using-graphql-typegen/graphql.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// You'll need to run 'gatsby develop' before this file exists
module.exports = require("./.cache/typegen/graphql.config.json")

0 comments on commit e84e69b

Please sign in to comment.