You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: Will the developer be responsible for first parsing the schema from a file?
11
13
// Can consider accepting a string representing a the filepath to a schema
@@ -50,7 +52,6 @@ export function expressRateLimiter(
50
52
console.log('There is no query on the request');
51
53
returnnext();
52
54
}
53
-
54
55
/**
55
56
* There are numorous ways to get the ip address off of the request object.
56
57
* - the header 'x-forward-for' will hold the originating ip address if a proxy is placed infront of the server. This would be commen for a production build.
@@ -68,10 +69,12 @@ export function expressRateLimiter(
68
69
// validate the query against the schema. The GraphQL validation function returns an array of errors.
69
70
constvalidationErrors=validate(schema,queryAST);
70
71
// check if the length of the returned GraphQL Errors array is greater than zero. If it is, there were errors. Call next so that the GraphQL server can handle those.
71
-
if(validationErrors.length>0)returnnext();
72
+
if(validationErrors.length>0){
73
+
// FIXME: Customize this error to throw the GraphQLError
0 commit comments