graphql-syntax-highlighter-react
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -53,4 +53,14 @@ 'use strict'; | ||
var formatted = (0, _printer.print)((0, _parser.parse)(queryBody)); | ||
var formatted = void 0; | ||
try { | ||
formatted = (0, _printer.print)((0, _parser.parse)(queryBody)); | ||
} catch (e) { | ||
return _react2.default.createElement( | ||
'div', | ||
{ className: className }, | ||
'Could not parse graphQL query' | ||
); | ||
} | ||
var highlighted = []; | ||
@@ -57,0 +67,0 @@ var rowKeys = []; |
{ | ||
"name": "graphql-syntax-highlighter-react", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A React component for highlighting GraphQL syntax.", | ||
@@ -31,4 +31,3 @@ "main": "dist/index.js", | ||
"babel-preset-es2015": "^6.13.2", | ||
"babel-preset-react": "^6.11.1", | ||
"mocha": "^4.0.1" | ||
"babel-preset-react": "^6.11.1" | ||
}, | ||
@@ -35,0 +34,0 @@ "peerDependencies": { |
@@ -17,4 +17,10 @@ import { LexRules, ParseRules, isIgnored } from './utils/Rules.js'; | ||
const { className, queryBody } = this.props; | ||
const formatted = print(parse(queryBody)); | ||
let formatted; | ||
try { | ||
formatted = print(parse(queryBody)); | ||
} catch (e) { | ||
return (<div className={className}>Could not parse graphQL query</div>); | ||
} | ||
const highlighted = []; | ||
@@ -21,0 +27,0 @@ const rowKeys = []; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
59480
5
21
1561