Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-print

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-print - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

2

package.json
{
"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
* )
* }
*/
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc