Collabsalot / gatsby-starter

A Gatsby starter
MIT License
2 stars 0 forks source link

Resolve gatsby-plugin-graphql-codegen warning #24

Open MartinRosenberg opened 4 years ago

MartinRosenberg commented 4 years ago

What does this mean?

warn [gatsby-plugin-ts] Unable to find any GraphQL type definitions for the following pointers: /[...]/gatsby-starter/.cache/fragments/*.js

d4rekanguok commented 4 years ago

Hey Martin, thank you for using gatsby-plugin-ts & gatsby-plugin-graphql-codegen!

By default, the plugin looks for graphql documents in .cache/fragments/*.js, which is where gatsby stores its plugins' fragments. If your gatsby project doesn't use any plugin that has fragments, that directory will be empty hence gatsby-plugin-graphql-codegen's warning.

Recently Gatsby move this fragment directory to node_modules/.cache instead, so if you're using newer version of gatsby, you'll see this warning more often.

Usually these warnings can be ignored. If it bothers you, since gatsby-plugin-ts 2.1 you can pass in custom document paths. Exclude the empty path will stop the warning.

Thanks again!