Skip to content

Commit

Permalink
Fix URLs to the GraphQL Specification and its repository (graphql#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored and jliu670 committed Aug 14, 2020
1 parent d1fd605 commit ace3bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ for example:

## Additional Validation Rules

GraphQL's [validation phase](https://facebook.github.io/graphql/#sec-Validation) checks the query to ensure that it can be successfully executed against the schema. The `validationRules` option allows for additional rules to be run during this phase. Rules are applied to each node in an AST representing the query using the Visitor pattern.
GraphQL's [validation phase](https://graphql.github.io/graphql-spec/#sec-Validation) checks the query to ensure that it can be successfully executed against the schema. The `validationRules` option allows for additional rules to be run during this phase. Rules are applied to each node in an AST representing the query using the Visitor pattern.

A validation rule is a function which returns a visitor for one or more node Types. Below is an example of a validation preventing the specific fieldname `metadata` from being queried. For more examples see the [`specifiedRules`](https://github.com/graphql/graphql-js/tree/master/src/validation/rules) in the [graphql-js](https://github.com/graphql/graphql-js) package.

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function graphqlHTTP(options: Options): Middleware {
})
.then(result => {
// Collect and apply any metadata extensions if a function was provided.
// http://facebook.github.io/graphql/#sec-Response-Format
// http://graphql.github.io/graphql-spec/#sec-Response-Format
if (result && extensionsFn) {
return Promise.resolve(
extensionsFn({
Expand Down Expand Up @@ -368,7 +368,7 @@ function graphqlHTTP(options: Options): Middleware {
// error, indicate as such with a generic status code.
// Note: Information about the error itself will still be contained in
// the resulting JSON payload.
// http://facebook.github.io/graphql/#sec-Data
// http://graphql.github.io/graphql-spec/#sec-Data
if (response.statusCode === 200 && result && !result.data) {
response.statusCode = 500;
}
Expand Down

0 comments on commit ace3bee

Please sign in to comment.