@magidoc/rollup-plugin-gql-schema
Advanced tools
Comparing version 3.0.4 to 3.0.5
import { isSpecifiedScalarType, print, isSpecifiedDirective } from 'graphql'; | ||
function printSchemaWithDirectives(schema) { | ||
const str = Object.keys(schema.getTypeMap()) | ||
.filter((k) => !k.match(/^__/)) | ||
.reduce((accum, name) => { | ||
const type = schema.getType(name); | ||
if (!type || !type.astNode) | ||
const str = Object.values(schema.getTypeMap()) | ||
.filter((k) => !k.name.match(/^__/)) | ||
.reduce((accum, type) => { | ||
if (isSpecifiedScalarType(type)) | ||
return accum; | ||
return !isSpecifiedScalarType(type) | ||
? (accum += `${print(type.astNode)}\n`) | ||
: accum; | ||
const typeString = type.astNode ? print(type.astNode) : ''; | ||
const extensionString = type.extensionASTNodes | ||
? type.extensionASTNodes.map((ast) => print(ast)).join('\n') | ||
: ''; | ||
return `${accum}\n${typeString}\n${extensionString}\n`; | ||
}, ''); | ||
@@ -14,0 +15,0 @@ return schema.getDirectives().reduce((accum, d) => { |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
17495
232