graphql-print
Advanced tools
Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "graphql-print", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "Print any GraphQL AST node, pretty or minified, with or without comments", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,12 +40,46 @@ # `graphql-print` | ||
const ast = parse("query MyQuery { myField(myArg: 42, myOtherArg: null)}"); | ||
const ast = parse(` | ||
query MyQuery { | ||
# select a field | ||
myField(myArg: 42, myOtherArg: null) | ||
} | ||
`); | ||
console.log(print(ast)); | ||
/** | ||
* Will print the following: | ||
* | ||
* query MyQuery { | ||
* myField(myArg: 42, myOtherArg: null) | ||
* } | ||
*/ | ||
console.log(print(ast, { minified: true })); | ||
/** | ||
* Will print the following: | ||
* | ||
* query MyQuery{myField(myArg:42,myOtherArg:null)} | ||
*/ | ||
console.log(print(ast, { preserveComments: true })); | ||
/** | ||
* Will print the following: | ||
* | ||
* query MyQuery { | ||
* # select a field | ||
* myField(myArg: 42, myOtherArg: null) | ||
* } | ||
*/ | ||
console.log(print(ast, { maxLineLength: 20 })); | ||
/** | ||
* Will print the following: | ||
* | ||
* query MyQuery { | ||
* myField( | ||
* myArg: 42 | ||
* myOtherArg: null | ||
* ) | ||
* } | ||
*/ | ||
``` |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
37212
1
85