You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
387 B
JavaScript
18 lines
387 B
JavaScript
"use strict";
|
|
|
|
const graphql = require("graphql");
|
|
|
|
module.exports = function createGraphQLInterface(schema, options, root) {
|
|
return function makeQuery(query, args) {
|
|
return graphql.graphql({
|
|
schema: schema,
|
|
source: query,
|
|
rootValue: root,
|
|
contextValue: {
|
|
data: (options.loaderFactory != null) ? options.loaderFactory() : {}
|
|
},
|
|
variableValues: args
|
|
});
|
|
};
|
|
};
|