express-graphql
Advanced tools
Comparing version 0.4.9 to 0.4.10
@@ -56,2 +56,3 @@ | ||
var operationName = undefined; | ||
var validationRules = undefined; | ||
@@ -70,2 +71,7 @@ // Use promises as a mechanism for capturing any thrown errors during the | ||
validationRules = _graphql.specifiedRules; | ||
if (optionsObj.validationRules) { | ||
validationRules = validationRules.concat(optionsObj.validationRules); | ||
} | ||
// GraphQL HTTP only supports GET and POST methods. | ||
@@ -117,3 +123,3 @@ if (request.method !== 'GET' && request.method !== 'POST') { | ||
// Validate AST, reporting any errors. | ||
var validationErrors = (0, _graphql.validate)(schema, documentAST); | ||
var validationErrors = (0, _graphql.validate)(schema, documentAST, validationRules); | ||
if (validationErrors.length > 0) { | ||
@@ -244,3 +250,8 @@ // Return 400: Bad Request if any validation errors exist. | ||
/** | ||
* An optional array of validation rules that will be applied on the document | ||
* in aditional to the rules in the GraphQL spec | ||
*/ | ||
/** | ||
* A boolean to optionally enable GraphiQL mode. | ||
*/ |
@@ -19,3 +19,3 @@ | ||
// Current latest version of GraphiQL. | ||
var GRAPHIQL_VERSION = '0.4.9'; | ||
var GRAPHIQL_VERSION = '0.6.0'; | ||
@@ -22,0 +22,0 @@ /** |
{ | ||
"name": "express-graphql", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"description": "Create a GraphQL HTTP server with Express.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -39,3 +39,3 @@ GraphQL Express Middleware | ||
provided, GraphQL's default spec-compliant [`formatError`][] function will | ||
be used. *To enable stack traces, provide the function: `error => error`.* | ||
be used. | ||
@@ -46,2 +46,16 @@ * **`graphiql`**: If `true`, may present [GraphiQL][] when loaded directly | ||
#### Debugging | ||
During development, it's useful to get more information from errors, such as | ||
stack traces. Providing a function to `formatError` enables this: | ||
```js | ||
formatError: error => ({ | ||
message: error.message, | ||
locations: error.locations, | ||
stack: error.stack | ||
}) | ||
``` | ||
### HTTP Usage | ||
@@ -48,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27989
371
150