TypeError: Cannot read properties of undefined (reading 'allBuilderModels')

Hi , I am using Gatsby 4 and I am getting following error when I run gatsby develop

ERROR #85923 GRAPHQL

There was an error in your GraphQL query:

Cannot query field “allBuilderModels” on type “Query”.

If you don’t expect “allBuilderModels” to exist on the type “Query” it is most likely a typo.
However, if you expect “allBuilderModels” to exist there are a couple of solutions to common problems:

  • If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
  • The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
  • You want to optionally use your field “allBuilderModels” and right now it is not used anywhere. Therefore Gatsby can’t infer the type and add it to the GraphQL schema. A quick fix is to add at least one
    entry with that field (“dummy content”)

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don’t have to add the mentioned “dummy content”. Visit our docs to learn how you can define the
schema for “Query”:

File: node_modules/@builder.io/gatsby/gatsby-node.js:52:24

ERROR #11321 PLUGIN

@builder.io/gatsby” threw an error while running the createPages lifecycle:

Cannot read properties of undefined (reading ‘allBuilderModels’)

63 | const component = config.templates[modelName];
64 | invariant(fs.existsSync(component), @builder.io/gatsby requires a valid template path for each model);

65 | let entries = result.data[config.fieldName][modelName];
| ^
66 | offsets[index] = offsets[index] + entries.length;
67 |
68 | if (entries.length === config.limit) {

File: node_modules/@builder.io/gatsby/gatsby-node.js:65:30

TypeError: Cannot read properties of undefined (reading ‘allBuilderModels’)

  • gatsby-node.js:65 createPagesAsync
    [fdc]/[@builder.io]/gatsby/gatsby-node.js:65:30

  • gatsby-node.js:158 Object.exports.createPages
    [fdc]/[@builder.io]/gatsby/gatsby-node.js:158:5

  • api-runner-node.js:462 runAPI
    [fdc]/[gatsby]/src/utils/api-runner-node.js:462:16

failed createPages - 0.056s
success createPagesStatefully - 0.039s
info Total nodes: 26, SitePage nodes: 4 (use --verbose for breakdown)
success Checking for changed pages - 0.000s
success write out redirect data - 0.001s
success onPostBootstrap - 0.000s
info bootstrap finished - 8.687s
success onPreExtractQueries - 0.000s

ERROR #85923 GRAPHQL

There was an error in your GraphQL query:

Cannot query field “page” on type “Query”.

If you don’t expect “page” to exist on the type “Query” it is most likely a typo.
However, if you expect “page” to exist there are a couple of solutions to common problems:

  • If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
  • The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
  • You want to optionally use your field “page” and right now it is not used anywhere. Therefore Gatsby can’t infer the type and add it to the GraphQL schema. A quick fix is to add at least one entry with
    that field (“dummy content”)

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don’t have to add the mentioned “dummy content”. Visit our docs to learn how you can define the
schema for “Query”:

File: src/templates/Page.tsx:17:13

failed extract queries from components - 0.087s
success write out requires - 0.004s

You can now view fdc in the browser.

http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site’s data and schema

http://localhost:8000/___graphql

Note that the development build is not optimized.
To create a production build, use gatsby build

success Building development bundle - 2.949s
success Writing page-data.json files to public directory - 0.040s - 1/2 49.78/s
success onPreExtractQueries - 0.001s

ERROR #85923 GRAPHQL

There was an error in your GraphQL query:

Cannot query field “allBuilderModels” on type “Query”.

If you don’t expect “allBuilderModels” to exist on the type “Query” it is most likely a typo.
However, if you expect “allBuilderModels” to exist there are a couple of solutions to common problems:

  • If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
  • The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
  • You want to optionally use your field “allBuilderModels” and right now it is not used anywhere. Therefore Gatsby can’t infer the type and add it to the GraphQL schema. A quick fix is to add at least one
    entry with that field (“dummy content”)

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don’t have to add the mentioned “dummy content”. Visit our docs to learn how you can define the
schema for “Query”:

File: src/templates/Page.tsx:16:9

Have followed all instructions in starter. Am I doing something wrong?

This issue is resolved. Did i clean setup and it worked.

Thanks

Hi! Can you explain how to do the clean setup? im having the same issue