В чистой реализации graphql мы можем запустить запрос из строки следующим образом:
var { graphql, buildSchema } = require('graphql');
var schema = buildSchema(`
type Query {
hello: String
}
`);
var root = { hello: () => 'Hello world!' };
graphql(schema, '{ hello }', root).then((response) => {
console.log(response);
});
Но не можем найти тот же метод в ApolloServer:
const server = new ApolloServer({ typeDefs, resolvers });
// something like this
server.runQuery('{ hello }');