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

@graphql-markdown/printer-legacy

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-markdown/printer-legacy - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

4

package.json

@@ -8,3 +8,3 @@ {

},
"version": "1.0.1",
"version": "1.1.0",
"license": "MIT",

@@ -26,3 +26,3 @@ "main": "src/index.js",

"dependencies": {
"@graphql-markdown/utils": "1.0.1"
"@graphql-markdown/utils": "1.1.0"
},

@@ -29,0 +29,0 @@ "directories": {

const {
isEnumType,
isUnionType,
isObjectType,
isScalarType,
isOperation,
getDefaultValue,
getTypeName,
getFields,
isDirectiveType,
isParametrizedField,
isInterfaceType,
getNamedType,
isInputType,
isListType,
isNonNullType,
isLeafType,
getRelationOfReturn,
getRelationOfField,
getRelationOfImplementation,
} = require("@graphql-markdown/utils").graphql;
const {
string: { toSlug, escapeMDX },
object: { hasProperty, hasMethod },
url: { pathUrl },
} = require("@graphql-markdown/utils").scalars;
graphql: {
isEnumType,
isUnionType,
isObjectType,
isScalarType,
isOperation,
getDefaultValue,
getTypeName,
getFields,
isDirectiveType,
isParametrizedField,
isInterfaceType,
getNamedType,
isInputType,
isListType,
isNonNullType,
isLeafType,
getRelationOfReturn,
getRelationOfField,
getRelationOfImplementation,
hasDirective,
},
} = require("@graphql-markdown/utils");

@@ -45,5 +45,6 @@ const {

linkRoot = "/",
{ groups, printTypeOptions } = {
{ groups, printTypeOptions, skipDocDirective } = {
groups: undefined,
printTypeOptions: undefined,
skipDocDirective: undefined,
},

@@ -58,2 +59,3 @@ ) {

this.typeBadges = printTypeOptions?.typeBadges ?? true;
this.skipDocDirective = skipDocDirective ?? undefined;
}

@@ -109,2 +111,6 @@

if (hasDirective(type, this.skipDocDirective)) {
return fallback;
}
const graphLQLNamedType = getNamedType(type);

@@ -382,5 +388,25 @@

printCodeDirectiveLocation(type) {
if (
typeof type.locations === "undefined" ||
type.locations == null ||
type.locations.length === 0
) {
return "";
}
let code = ` on `;
const separator = `\r\n | `;
if (type.locations.length > 1) {
code += separator;
}
code += type.locations.join(separator).trim();
return code;
}
printCodeDirective(type) {
let code = `directive @${getTypeName(type)}`;
code += this.printCodeArguments(type);
code += this.printCodeDirectiveLocation(type);

@@ -486,2 +512,3 @@ return code;

let metadata;
switch (true) {

@@ -498,3 +525,3 @@ case isScalarType(type):

case isInterfaceType(type):
case isInputType(type):
case isInputType(type): {
metadata = this.printSection(getFields(type), "Fields", {

@@ -507,18 +534,21 @@ parentType: type.name,

return metadata;
case isDirectiveType(type):
case isOperation(type):
}
case isDirectiveType(type): {
metadata = this.printSection(type.args, "Arguments", {
parentType: type.name,
});
return metadata;
}
case isOperation(type): {
metadata = this.printSection(type.args, "Arguments", {
parentType: type.name,
});
const queryType = getTypeName(type.type).replace(/[![\]]*/g, "");
metadata += this.printSection([this.schema.getType(queryType)], "Type");
if (isOperation(type)) {
const queryType = getTypeName(type.type).replace(/[![\]]*/g, "");
metadata += this.printSection(
[this.schema.getType(queryType)],
"Type",
);
}
return metadata;
}
default:
return metadata;
}
return metadata;
}

@@ -525,0 +555,0 @@

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