gatsby-typescript
gatsby-typescript copied to clipboard
Minified react error: Objects are not valid as a React child error
Describe the bug Using plugin results in error
Minified react error.... Objects are not valid as a React child (found: AggregateError: GraphQL Document Validation failed with 13 errors; Error 0: GraphQLDocumentError: Cannot query field "contentfulMarkdownContent" on type "Query". Did you mean "contentfulDropdownItem", "contentfulComponentText", "contentfulFooPageNew", "contentfulComponentHero", or "contentfulComponentNav"
To Reproduce Configure plugin gatsby-plugin-typescript and start project.
{ resolve: 'gatsby-plugin-graphql-codegen', options: { documentPaths: [ './src/**/*.{ts,tsx}', './.cache/fragments/*.js', './.cache/fragments/*.ts', '../../node_modules/gatsby-*/**/*.js', '../../node_modules/gatsby-*/**/*.ts', ], }, },
Environment (please complete the relevant info):
- OS (Mac, Linux, Window, etc.)
- Mac
- Gatsby version 5.9.0
- Typescript version -4.4.0
Additional context Using with gatsby-source-contentful Monorepo structure
Hi there, did you try exluding your plugin ?
{
resolve: `gatsby-plugin-graphql-codegen`,
options: {
documentPaths: [
'./src/**/*.{ts,tsx}',
'./.cache/fragments/*.{js,ts}',
'../../node_modules/gatsby!(*source-contentful)/**/*.{js,ts}',
],
},
},