【发布时间】:2020-09-11 08:33:29
【问题描述】:
我需要从服务器上运行的 cron 作业中调用一个突变。 I found this SO post,但接受的答案说没有办法。
Then I found this on GitHub, from 2017:
graphql-server是graphql core函数的网络包装器。如果你 不想通过网络使用它,你可以单独运行它:import scheme from './scheme'; const query = `{ me { name } }`; const result = graphql(scheme, query); console.log(result);函数文档可以找到here
看起来不错!这是 2020 年的最佳实践方法吗?
【问题讨论】:
标签: graphql apollo apollo-server