【发布时间】:2020-04-27 20:46:07
【问题描述】:
是否可以使用非 Apollo 客户端(例如 graphql.js - https://github.com/f/graphql.js)连接到 Apollo GraphQL 服务器?
如果是这样,应该使用哪个端点?还是有其他方法?
这会失败并出现HTTP 500 服务器错误:
const graph = graphql('http://localhost:3013/graphql', {
method: 'POST' // POST by default.
});
const res = graph(`query getQuestions {
questions {
id,
question
}
}
`);
res().
then((result) => console.log(result))
.catch((err) => console.log(err));
【问题讨论】:
标签: graphql apollo-client apollo-server