React Apollo -GraphQl文件未更新/反映更改
我正在将React应用程序升级到第18版,它仍在进行中,但是我面临着GraphQl查询的怪异行为。我正在使用React Apollo来管理所有前端存储数据和GraphQl宏来加载所有GraphQl文件。每当我们对 *.gql进行任何更改时,也更早。我们过去曾在CRA配置中默认观看(热重新加载)这些文件,但即使我已经进行了任何更改,添加或删除了GQL查询/突变中的任何字段,因此这些文件不在CRA配置中。我的应用程序仍在尝试加载以前的查询。即使重新启动服务器也无济于事。有时候它有效,大多数情况下它不起作用。
I am upgrading my react app to version 18, its still in progress but i am facing a weird behaviour with graphql queries. I am using React Apollo to manage all the frontend store data and graphql macro to load all graphql files. Earlier also every time we make any changes in *.gql. We used to restart the server as those files are not by default watched(hot reload) in CRA config but currently even if i had made any changes, added or removed any fields from gql query/mutations. My application is still trying to load the previous queries. Even restarting the server is not helping. Sometime it works and most of the time it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过清除node_modules生成的缓存来解决此问题。另外,我还通过附加缓存Clear命令来更新开始脚本。
参考 -
I was able to resolve this problem by clearing the cache which was being generated in node_modules. Also i have updated the start script by appending the cache clear command.
Reference - Clean Create React App's cache when importing graphql files