【问题标题】:Gatsby: Installed a new theme, deleted it, now my app is broke盖茨比:安装了一个新主题,删除它,现在我的应用程序坏了
【发布时间】: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


【解决方案1】:

卸载您的主题可能会删除 themeUiConfig 数据,或您的应用与它的连接。

找到出错的 graphQL 查询,然后删除或重新连接该请求。

或者,您的新主题可能需要一些数据,因此请确保您已完成正确卸载它的步骤。或者,如果您使用 Git 之类的源代码控制,您可以在线搜索revert 您的提交并将您的代码撤消到它工作的时间的方法。

【讨论】:

  • 我是 Gatsby 和 GraphQL 的新手。我不知道该怎么做。我在我的应用程序中没有看到任何查询 themeUiConfig
  • rm -rf .cache && gatsby develop
猜你喜欢
  • 1970-01-01
  • 2020-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-18
  • 2011-01-17
  • 2017-01-31
相关资源
最近更新 更多