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

@graphitation/graphql-codegen-supermassive-schema-extraction-plugin

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphitation/graphql-codegen-supermassive-schema-extraction-plugin - npm Package Compare versions

Comparing version 1.2.1 to 2.0.0

13

CHANGELOG.md
# Change Log - @graphitation/graphql-codegen-supermassive-schema-extraction-plugin
This log was last generated on Thu, 21 Sep 2023 06:27:50 GMT and should not be manually modified.
This log was last generated on Tue, 19 Dec 2023 11:03:51 GMT and should not be manually modified.
<!-- Start content -->
## 2.0.0
Tue, 19 Dec 2023 11:03:51 GMT
### Major changes
- Update graphql-codegen-supermassive-schema-extraction-plugin for usage with supermassive v3 (vladimir.razuvaev@gmail.com)
- Bump @graphitation/supermassive to v3.2.7
## 1.2.1
Thu, 21 Sep 2023 06:27:50 GMT
Thu, 21 Sep 2023 06:28:45 GMT

@@ -11,0 +20,0 @@ ### Patches

25

lib/index.js
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -56,12 +46,13 @@ var __async = (__this, __arguments, generator) => {

module.exports = __toCommonJS(src_exports);
var import_typescript = __toESM(require("typescript"));
var import_graphql2 = require("graphql");
var import_supermassive_extractors = require("@graphitation/supermassive-extractors");
var import_supermassive = require("@graphitation/supermassive");
var import_path = require("path");
const plugin = (schema) => {
const tsContents = (0, import_supermassive_extractors.extractImplicitTypesToTypescript)(
(0, import_graphql2.parse)((0, import_graphql2.printSchema)(schema))
const schemaAST = (0, import_graphql2.parse)((0, import_graphql2.printSchema)(schema));
const typeDefs = (0, import_supermassive.mergeSchemaDefinitions)(
{ types: {} },
(0, import_supermassive.encodeASTSchema)(schemaAST)
);
const printer = import_typescript.default.createPrinter();
return printer.printNode(import_typescript.default.EmitHint.SourceFile, tsContents, tsContents);
return `export const definitions = JSON.parse('${JSON.stringify(typeDefs)}');
`;
};

@@ -71,5 +62,5 @@ const validate = (schema, documents, config, outputFile) => __async(void 0, null, function* () {

throw new Error(
`Plugin "supermassive-typed-document-node" requires extension to be ".ts" or ".tsx"!`
`Plugin "graphql-codegen-supermassive-schema-extraction-plugin" requires extension to be ".ts" or ".tsx"!`
);
}
});
{
"name": "@graphitation/graphql-codegen-supermassive-schema-extraction-plugin",
"license": "MIT",
"version": "1.2.1",
"version": "2.0.0",
"main": "./lib/index",

@@ -20,11 +20,9 @@ "repository": {

"@types/jest": "^26.0.22",
"monorepo-scripts": "*",
"typescript": "^4.9.5"
"monorepo-scripts": "*"
},
"peerDependencies": {
"@graphql-codegen/plugin-helpers": ">= 1.18.0 < 2",
"typescript": "^4.3.0"
"@graphql-codegen/plugin-helpers": ">= 1.18.0 < 2"
},
"dependencies": {
"@graphitation/supermassive-extractors": "^2.2.1",
"@graphitation/supermassive": "^3.0.0",
"graphql": "^15.0.0"

@@ -31,0 +29,0 @@ },

# Custom GraphQL codegen plugins
## supermassive-typed-document-node
## graphql-codegen-supermassive-schema-extraction-plugin
Do the same stuff as the original typed-document-node plugin except it extends GraphQL AST data to match Supermassive AST
Encodes type definitions into compact schema format of Supermassive V3.
Output file contains JSON, which is faster than JS literal: https://v8.dev/blog/cost-of-javascript-2019#json

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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