Skip to content

Commit 573f6e5

Browse files
authored
Merge pull request #34 from kusor/master
Bump dependencies
2 parents f72526b + 4043f5d commit 573f6e5

File tree

6 files changed

+74
-65
lines changed

6 files changed

+74
-65
lines changed

example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const schema = `
1616
}
1717
`;
1818

19-
const getPerson = function (args, request) {
19+
const getPerson = function(args, request) {
2020
return new Promise((resolve) => {
2121
resolve({ firstname: 'billy', lastname: 'jean' });
2222
});

lib/index.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const internals = {
2020

2121
exports.name = 'graphi';
2222

23-
exports.register = function (server, options) {
23+
exports.register = function(server, options) {
2424
const settings = Merge({}, internals.defaults, options);
2525

2626
server.expose('resolvers', {});
@@ -82,7 +82,7 @@ exports.graphql = Graphql;
8282

8383
exports.makeExecutableSchema = Utils.makeExecutableSchema;
8484

85-
internals.registerSchema = function ({ schema = {}, resolvers = {}, subscriptionOptions = {} }) {
85+
internals.registerSchema = function({ schema = {}, resolvers = {}, subscriptionOptions = {} }) {
8686
const server = this;
8787
if (typeof schema === 'string') {
8888
schema = Utils.makeExecutableSchema({ schema, resolvers });
@@ -97,7 +97,7 @@ internals.registerSchema = function ({ schema = {}, resolvers = {}, subscription
9797
server.plugins.graphi.schema = schema;
9898
};
9999

100-
internals.onPreStart = function (server) {
100+
internals.onPreStart = function(server) {
101101
const resolver = ({ prefix = '', method = 'graphql' }) => {
102102
return async (payload, request, ast) => {
103103
const url = `${prefix}/${ast.fieldName}`;
@@ -134,7 +134,7 @@ internals.onPreStart = function (server) {
134134
});
135135
};
136136

137-
internals.graphqlHandler = async function (request, h) {
137+
internals.graphqlHandler = async function(request, h) {
138138
if (request.method.toUpperCase() === 'OPTIONS') {
139139
return h.continue;
140140
}
@@ -204,7 +204,16 @@ internals.graphqlHandler = async function (request, h) {
204204
return result;
205205
};
206206

207-
const result = await Graphql.execute(schema, queryAST, resolvers, request, variables, operationName, fieldResolver);
207+
const result = await Graphql.execute({
208+
schema,
209+
document: queryAST,
210+
rootValue: resolvers,
211+
contextValue: request,
212+
variableValues: variables,
213+
operationName,
214+
fieldResolver
215+
});
216+
208217
if (result.errors) {
209218
const formatError = request.server.plugins.graphi.settings.formatError;
210219
if (typeof formatError === 'function') {
@@ -225,7 +234,7 @@ internals.graphqlHandler = async function (request, h) {
225234
return result;
226235
};
227236

228-
internals.graphiqlHandler = function (request, h) {
237+
internals.graphiqlHandler = function(request, h) {
229238
const { settings } = request.server.plugins.graphi;
230239
const query = request.query;
231240
const variables = query.variables || '{}';
@@ -239,7 +248,7 @@ internals.graphiqlHandler = function (request, h) {
239248
});
240249
};
241250

242-
internals.tryParseVariables = function (input) {
251+
internals.tryParseVariables = function(input) {
243252
if (!input || typeof input !== 'string') {
244253
return input;
245254
}

lib/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ exports.makeExecutableSchema = ({ schema, resolvers = {}, preResolve }) => {
5353
return astSchema;
5454
};
5555

56-
exports.registerSubscriptions = function (server, schema, options) {
56+
exports.registerSubscriptions = function(server, schema, options) {
5757
const fields = schema._subscriptionType.getFields();
5858
const fieldKeys = Object.keys(fields);
5959
for (const fieldKey of fieldKeys) {
@@ -71,8 +71,8 @@ exports.registerSubscriptions = function (server, schema, options) {
7171
}
7272
};
7373

74-
exports.publish = function (server) {
75-
return function (name, obj) {
74+
exports.publish = function(server) {
75+
return function(name, obj) {
7676
const schema = this.schema;
7777

7878
const field = schema._subscriptionType.getFields()[name];
@@ -91,7 +91,7 @@ exports.publish = function (server) {
9191
};
9292
};
9393

94-
internals.wrapResolve = function (resolve) {
94+
internals.wrapResolve = function(resolve) {
9595
return (root, args, request) => {
9696
const preResolve = this;
9797
const context = preResolve(root, args, request);

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
},
2626
"homepage": "https://github.com/geek/graphi#readme",
2727
"devDependencies": {
28-
"belly-button": "7.x.x",
28+
"belly-button": "8.x.x",
2929
"cb-barrier": "1.x.x",
30-
"@hapi/code": "8.x.x",
31-
"@hapi/eslint-plugin": "5.x.x",
32-
"@hapi/hapi": "20.x.x",
30+
"@hapi/code": "9.x.x",
31+
"@hapi/eslint-plugin": "6.x.x",
32+
"@hapi/hapi": "21.x.x",
3333
"hapi-auth-bearer-token": "8.x.x",
34-
"@hapi/lab": "24.x.x",
35-
"@hapi/nes": "12.x.x",
34+
"@hapi/lab": "25.x.x",
35+
"@hapi/nes": "13.x.x",
3636
"opentracing": "0.14.x",
3737
"traci": "3.x.x",
38-
"@hapi/wreck": "17.x.x"
38+
"@hapi/wreck": "18.x.x"
3939
},
4040
"dependencies": {
41-
"@hapi/boom": "9.x.x",
42-
"graphql": "15.x.x",
41+
"@hapi/boom": "10.x.x",
42+
"graphql": "16.6.x",
4343
"apollo-server-module-graphiql": "1.4.x",
4444
"lodash.merge": "4.6.x"
4545
}

0 commit comments

Comments
 (0)