Types for gatsby-node.ts
See original GitHub issueIssue Description
Hi, I’m trying to get types generated for my root query in gatsby-node.ts.
Somehow this seems to not work. I used a query name (e.g. query GatsbyNode ...
) as with all my other queries. All other type generation works fine, just not the gatsby-node.ts ones.
What am I doing wrong here
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top Results From Across the Web
TypeScript and Gatsby
Read the Gatsby Config API documentation to learn more about its different options. gatsby-node.ts. Support added in gatsby@4.9.0. You can import ...
Read more >TypeScript + Gatsby config and node API - gists · GitHub
js. // Use the type definitions that are included with Gatsby. import { GatsbyNode } from "gatsby"; import { resolve } from "path";...
Read more >How to use Gatsby with Typescript. - DEV Community
Its really useful to install types for react, react-dom, ... src/app/GatsbyNode.ts , but you have to make sure you export the functions with ......
Read more >Gatsby config with TypeScript - miyauci.me
gatsby-config.ts. ├── gatsby-node.js. └── gatsby-ssr.js. bash. From now on, we will configure gatsby-config.ts with types. It will look like this:.
Read more >How To Set Up a Gatsby Project with TypeScript - DigitalOcean
Head over to your preferred browser and type ... This includes gatsby-node.js , gatsby-browser.js , and gatsby-ssr.js : rm gatsby-node.js ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As part of this RFC/Initiative https://github.com/gatsbyjs/gatsby/discussions/35420 I have a WIP PR up for an initial implementation. I have support for
gatsby-node.ts
working. I’d be really happy if you could follow that discussion and once I have a version published to try out, you could try it out. Thanks!As a temporary workaround I added the following
codegen.yml
to my project:Then I run a generate script defined as such:
This makes the type generation for the
gatsby-*.ts
files out-of-band, but it works for me for root queries until this plugin supportsgatsby-node.ts
.