【发布时间】:2020-08-12 02:36:06
【问题描述】:
我是 Gatsby 的新手,并构建了一个带有入门主题的基本应用程序。在启动并运行主题后,我决定安装一个新主题。我无法让主题工作并卸载它,但现在我收到了错误:
There was an error in your GraphQL query:
Cannot query field "themeUiConfig" on type "Query".
If you don't expect "themeUiConfig" to exist on the type "Query" it is most likely a typo.
However, if you expect "themeUiConfig" 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 "themeUiConfig" 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 a 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /Users/nick/Desktop/ui-website-sandbox/gatsby_crash_course/node_modules/gatsby-plugin-theme-ui/src/hooks/configOptions.js
多次重新启动服务器,但无法解决此问题。我该如何解决这个问题?
【问题讨论】:
-
git - 恢复到以前的版本?
标签: reactjs graphql themes gatsby