-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby doesn't extract graphql from TypeScript files #3102
Comments
You should be able to solve this by creating a declarations.d.ts file in your ./src folder and add the following: Probably not ideal, but at least this is the way they solved the issue in the gatsby-typescript-starter: |
@cfowlerdev That does not do the trick, unfortunately. I had to do that to solve TypeScript complaining about |
Ah, I figured out what's going on! |
Okay, needed to change |
Yes, looks like it's down to your compiler options. Have you tried changing the target from "es5" to "esnext" in your typescript options in gatsby-config.js? |
ah! you beat me to it :) good to hear you solved it |
By seconds! 😅 Thanks for helping out, regardless! |
From what I saw, when you set the typescript compiler to target |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
I recently started using
gatsby-plugin-typescript
to convert a project to TypeScript. It's been working fine so far, but when I converted a file containing agraphql
-tag, I got the following errow when building:I assume this is because the
graphql
-tags are not extracted as they should be, although I'm not sure.I'm running the latest version of Gatsby as of writing this (1.9.127) on Arch Linux with node v9.2.0. Here are my relevant files asked for in CONTRIBUTING.md:
gatsby-config.js
:package.json
:gatsby-node.js
:The text was updated successfully, but these errors were encountered: