我是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
多次重新启动服务器,但不能解决此问题。我该如何解决?
答案 0 :(得分:0)
卸载主题可能会删除JPanel panel = new JPanel()
{
protected void paintComponent(Graphics g)
{
g.setColor( getBackground() );
g.fillRect(0, 0, getWidth(), getHeight());
super.paintComponent(g);
}
};
panel.setOpaque(false); // background of parent will be painted first
条数据,或者您的应用与其连接。
找到出错的graphQL查询,然后删除或重新连接该请求。
或者,可能是您的新主题需要一些数据,因此请确保已完成正确卸载它的步骤。或者,如果您使用的是Git之类的源代码控制,则可以在线搜索themeUiConfig
提交的方法,然后将代码撤消,使其恢复正常工作。