Mirror: The small sibling of the graphql package, slimmed down for client-side libraries.

Upgrade to graphql@16.1.0

Changed files
+54 -22
alias
+37 -15
alias/error/GraphQLError.mjs
···
}
}
+
toJSON() {
+
const formattedError = { message: this.message };
+
+
if (this.locations != null) formattedError.locations = this.locations;
+
if (this.path != null) formattedError.path = this.path;
+
if (this.extensions != null && Object.keys(this.extensions).length > 0)
+
formattedError.extensions = this.extensions;
+
return formattedError;
+
}
+
toString() {
-
return printError(this);
+
let output = error.message;
+
+
if (error.nodes) {
+
for (const node of error.nodes) {
+
if (node.loc) {
+
output += '\n\n' + printLocation(node.loc);
+
}
+
}
+
} else if (error.source && error.locations) {
+
for (const location of error.locations) {
+
output += '\n\n' + printSourceLocation(error.source, location);
+
}
+
}
+
+
return output;
}
}
/**
* Prints a GraphQLError to a string, representing useful location information
* about the error's position in the source.
+
*
+
* @deprecated Please use `error.toString` instead. Will be removed in v17
*/
export function printError(error) {
-
let output = error.message;
-
-
if (error.nodes) {
-
for (const node of error.nodes) {
-
if (node.loc) {
-
output += '\n\n' + printLocation(node.loc);
-
}
-
}
-
} else if (error.source && error.locations) {
-
for (const location of error.locations) {
-
output += '\n\n' + printSourceLocation(error.source, location);
-
}
-
}
+
return error.toString();
+
}
-
return output;
+
/**
+
* Given a GraphQLError, format it according to the rules described by the
+
* Response Format, Errors section of the GraphQL Specification.
+
*
+
* @deprecated Please use `error.toString` instead. Will be removed in v17
+
*/
+
export function formatError(error) {
+
return error.toJSON();
}
+4 -4
alias/language/blockString.mjs
···
return '"""\n' + JSON.stringify(str).slice(1, -1) + '\n"""';
}
-
export function dedentBlockStringValue(str) {
-
return str;
+
export function isPrintableAsBlockString(value) {
+
return true;
}
-
export function getBlockStringIndentation(str) {
-
return 0;
+
export function dedentBlockStringLines(lines) {
+
return lines;
}
+7 -2
alias/language/visitor.mjs
···
-
import { getVisitFn, visitInParallel, BREAK } from 'graphql/language/visitor';
+
import {
+
getEnterLeaveForKind,
+
getVisitFn,
+
visitInParallel,
+
BREAK,
+
} from 'graphql/language/visitor';
-
export { getVisitFn, visitInParallel, BREAK };
+
export { getEnterLeaveForKind, getVisitFn, visitInParallel, BREAK };
export function visit(node, visitor) {
const path = [];
+1 -1
package.json
···
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
-
"graphql": "^16.0.0-alpha.5",
+
"graphql": "^16.1.0",
"husky-v4": "^4.3.8",
"jest": "^27.1.0",
"lint-staged": "^11.1.2",
+5
yarn.lock
···
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.0.0-alpha.5.tgz#8ae76728e91a50c59197a03cdbad9beb7fb9f704"
integrity sha512-C663Sh9qqetzqo0LbNrcptpQw8lTAOm8EF6rCd3tVAjTXTOkGbevZ67TtVb9WrkYQvNtFPlAFLVnqnkAGcVpYA==
+
graphql@^16.1.0:
+
version "16.1.0"
+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.1.0.tgz#83bebeae6e119766d04966f09de9305be7fd44e5"
+
integrity sha512-+PIjmhqGHMIxtnlEirRXDHIzs0cAHAozKG5M2w2N4TnS8VzCxO3bbv1AW9UTeycBfl2QsPduxcVrBvANFKQhiw==
+
has-bigints@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113"