【发布时间】:2021-10-14 12:09:06
【问题描述】:
我正在使用 nextjs 并且(graphql 的新手)尝试使用 graphql 端点从 wordpress 获取数据
我关注了这个回购
https://github.com/alexander-young/wp-next-headless
本教程
https://www.youtube.com/watch?v=bIc6NrPsHjs
但是遇到这个错误
FetchError:http://www.ahmedsamir.rf.gd/graphql 处的无效 json 响应正文原因:意外的令牌
关于查询的部分工作正常,知道吗?
【问题讨论】:
-
跨域问题?
-
但这在教程中有效吗?
-
你能发布graphql响应吗?
-
你是这个意思? {“数据”:{“帖子”:{“节点”:[{“标题”:“123”,“slug”:“123”},{“标题”:“测试”,“slug”:“测试” }, { "title": "Hello world!", "slug": "hello-world" } ] } },
-
我会假设您的文件中没有
<?
标签: reactjs wordpress graphql next.js