我想通过 Apollo 向此服务器发送请求并获取查询:
const client = new ApolloClient({
link: new HttpLink({
uri:' http://mfapat.com/graphql/mfaapp/ '}),
cache: new InMemoryCache()
})
const FeedQuery = gql
query{
allFmr{
fmrId,
name,
studio,
bedRm1,
bedRm2,
bedRm3,
bedRm4
}
}
` 但我正面临此错误消息:
未处理(在 react-apollo:Apollo(FMRScreen) 中)错误:网络错误:意外令牌 < JSON 中的位置 1
at new ApolloError (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:109336:32)
at ObservableQuery.currentResult (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:109447:28)
at GraphQL.dataForChild (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:103192:66)
at GraphQL.render (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:103243:37)
Run Code Online (Sandbox Code Playgroud)
....
但是我可以轻松地在浏览器中打开“ http://mfapat.com/graphql/mfaapp/ ”并进行查询。有谁知道问题出在哪里?