INNER CODE UNIT · JavaScript
thinkGraphql
thinkjs/thinkjs · packages/think-apollo-graphql/index.js:9
function thinkGraphql(options, ctx = this.ctx) {
assert(options, `Graphql expects exactly graphql options`);
return runHttpQuery([ctx], {
method: ctx.method,
options: options,
query: ctx.method === 'GET' ? ctx.param() : ctx.post()
}).then(res => {
return res;
}, err => {
if ('HttpQueryError' !== err.name) {
throw err;
}
return err;
});
}
/**