New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pothos/plugin-sub-graph

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

@pothos/plugin-sub-graph - npm Package Compare versions

Comparing version 3.5.0 to 3.6.0

10

CHANGELOG.md
# Change Log
## 3.6.0
### Minor Changes
- 3a7ff291: Refactor internal imports to remove import cycles
### Patch Changes
- 3a7ff291: Update dev dependencies
## 3.5.0

@@ -4,0 +14,0 @@

2

dts/global-types.d.ts
import { FieldNullability, InputFieldMap, InterfaceParam, RootName, SchemaTypes, TypeParam } from '@pothos/core';
import { PothosSubGraphPlugin } from '.';
import type { PothosSubGraphPlugin } from '.';
declare global {

@@ -4,0 +4,0 @@ export namespace PothosSchemaTypes {

@@ -60,6 +60,6 @@ /* eslint-disable prefer-destructuring */ import './global-types.js';

else if (type instanceof GraphQLInterfaceType) {
const typeConfig = type.toConfig();
const typeConfig1 = type.toConfig();
newTypes.set(type.name, new GraphQLInterfaceType({
...typeConfig,
interfaces: () => typeConfig.interfaces.map((iface) => replaceType(iface, newTypes, typeConfig.name, subGraphs)),
...typeConfig1,
interfaces: () => typeConfig1.interfaces.map((iface) => replaceType(iface, newTypes, typeConfig1.name, subGraphs)),
fields: this.filterFields(type, newTypes, subGraphs)

@@ -69,12 +69,12 @@ }));

else if (type instanceof GraphQLUnionType) {
const typeConfig = type.toConfig();
const typeConfig2 = type.toConfig();
newTypes.set(type.name, new GraphQLUnionType({
...typeConfig,
types: () => typeConfig.types.map((member) => replaceType(member, newTypes, typeConfig.name, subGraphs))
...typeConfig2,
types: () => typeConfig2.types.map((member) => replaceType(member, newTypes, typeConfig2.name, subGraphs))
}));
}
else if (type instanceof GraphQLInputObjectType) {
const typeConfig = type.toConfig();
const typeConfig3 = type.toConfig();
newTypes.set(type.name, new GraphQLInputObjectType({
...typeConfig,
...typeConfig3,
fields: this.mapInputFields(type, newTypes, subGraphs)

@@ -155,3 +155,3 @@ }));

onOutputFieldConfig(fieldConfig) {
var ref, ref2;
var ref, ref1;
const typeConfig = this.buildCache.getTypeConfig(fieldConfig.parentType);

@@ -169,9 +169,9 @@ if (typeConfig.graphqlKind !== "Interface" && typeConfig.graphqlKind !== "Object") {

else if ((ref = this.builder.options.subGraphs) === null || ref === void 0 ? void 0 : ref.fieldsInheritFromTypes) {
var ref2;
subGraphs = ((ref2 = typeConfig.extensions) === null || ref2 === void 0 ? void 0 : ref2.subGraphs) || [];
}
else if ((ref1 = this.builder.options.subGraphs) === null || ref1 === void 0 ? void 0 : ref1.defaultForFields) {
var ref3;
subGraphs = ((ref3 = typeConfig.extensions) === null || ref3 === void 0 ? void 0 : ref3.subGraphs) || [];
subGraphs = (ref3 = this.builder.options.subGraphs) === null || ref3 === void 0 ? void 0 : ref3.defaultForFields;
}
else if ((ref2 = this.builder.options.subGraphs) === null || ref2 === void 0 ? void 0 : ref2.defaultForFields) {
var ref4;
subGraphs = (ref4 = this.builder.options.subGraphs) === null || ref4 === void 0 ? void 0 : ref4.defaultForFields;
}
return {

@@ -178,0 +178,0 @@ ...fieldConfig,

@@ -1,2 +0,2 @@

"use strict";
/* eslint-disable @typescript-eslint/no-unused-vars */ "use strict";
Object.defineProperty(exports, "__esModule", {

@@ -3,0 +3,0 @@ value: true

@@ -1,20 +0,29 @@

"use strict";
/* eslint-disable prefer-destructuring */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
default: ()=>_default,
PothosSubGraphPlugin: ()=>PothosSubGraphPlugin
});
require("./global-types");
var _graphql = require("graphql");
var _core = _interopRequireWildcard(require("@pothos/core"));
var _util = require("./util");
function _getRequireWildcardCache() {
const _graphql = require("graphql");
const _core = /*#__PURE__*/ _interopRequireWildcard(require("@pothos/core"));
const _util = require("./util");
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cache = new WeakMap();
_getRequireWildcardCache = function() {
return cache;
};
return cache;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;

@@ -27,3 +36,3 @@ }

}
var cache = _getRequireWildcardCache();
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {

@@ -35,3 +44,3 @@ return cache.get(obj);

for(var key in obj){
if (Object.prototype.hasOwnProperty.call(obj, key)) {
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;

@@ -52,4 +61,3 @@ if (desc && (desc.get || desc.set)) {

const pluginName = 'subGraph';
var _default = pluginName;
exports.default = _default;
const _default = pluginName;
function intersect(left, right) {

@@ -102,27 +110,22 @@ for (const entry of left){

...typeConfig,
interfaces: ()=>typeConfig.interfaces.map((iface)=>(0, _util).replaceType(iface, newTypes, typeConfig.name, subGraphs)
)
,
interfaces: ()=>typeConfig.interfaces.map((iface)=>(0, _util.replaceType)(iface, newTypes, typeConfig.name, subGraphs)),
fields: this.filterFields(type, newTypes, subGraphs)
}));
} else if (type instanceof _graphql.GraphQLInterfaceType) {
const typeConfig = type.toConfig();
const typeConfig1 = type.toConfig();
newTypes.set(type.name, new _graphql.GraphQLInterfaceType({
...typeConfig,
interfaces: ()=>typeConfig.interfaces.map((iface)=>(0, _util).replaceType(iface, newTypes, typeConfig.name, subGraphs)
)
,
...typeConfig1,
interfaces: ()=>typeConfig1.interfaces.map((iface)=>(0, _util.replaceType)(iface, newTypes, typeConfig1.name, subGraphs)),
fields: this.filterFields(type, newTypes, subGraphs)
}));
} else if (type instanceof _graphql.GraphQLUnionType) {
const typeConfig = type.toConfig();
const typeConfig2 = type.toConfig();
newTypes.set(type.name, new _graphql.GraphQLUnionType({
...typeConfig,
types: ()=>typeConfig.types.map((member)=>(0, _util).replaceType(member, newTypes, typeConfig.name, subGraphs)
)
...typeConfig2,
types: ()=>typeConfig2.types.map((member)=>(0, _util.replaceType)(member, newTypes, typeConfig2.name, subGraphs))
}));
} else if (type instanceof _graphql.GraphQLInputObjectType) {
const typeConfig = type.toConfig();
const typeConfig3 = type.toConfig();
newTypes.set(type.name, new _graphql.GraphQLInputObjectType({
...typeConfig,
...typeConfig3,
fields: this.mapInputFields(type, newTypes, subGraphs)

@@ -151,3 +154,3 @@ }));

astNode: argConfig.astNode,
type: (0, _util).replaceType(argConfig.type, newTypes, `${argConfig.name} argument of ${type.name}.${fieldConfig.name}`, subGraphs)
type: (0, _util.replaceType)(argConfig.type, newTypes, `${argConfig.name} argument of ${type.name}.${fieldConfig.name}`, subGraphs)
};

@@ -162,3 +165,3 @@ });

astNode: fieldConfig.astNode,
type: (0, _util).replaceType(fieldConfig.type, newTypes, `${type.name}.${fieldConfig.name}`, subGraphs),
type: (0, _util.replaceType)(fieldConfig.type, newTypes, `${type.name}.${fieldConfig.name}`, subGraphs),
args: newArguments

@@ -181,3 +184,3 @@ };

defaultValue: fieldConfig.defaultValue,
type: (0, _util).replaceType(fieldConfig.type, newTypes, `${type.name}.${fieldConfig.name}`, subGraphs)
type: (0, _util.replaceType)(fieldConfig.type, newTypes, `${type.name}.${fieldConfig.name}`, subGraphs)
};

@@ -206,3 +209,3 @@ });

onOutputFieldConfig(fieldConfig) {
var ref, ref2;
var ref, ref1;
const typeConfig = this.buildCache.getTypeConfig(fieldConfig.parentType);

@@ -218,7 +221,7 @@ if (typeConfig.graphqlKind !== 'Interface' && typeConfig.graphqlKind !== 'Object') {

} else if ((ref = this.builder.options.subGraphs) === null || ref === void 0 ? void 0 : ref.fieldsInheritFromTypes) {
var ref2;
subGraphs = ((ref2 = typeConfig.extensions) === null || ref2 === void 0 ? void 0 : ref2.subGraphs) || [];
} else if ((ref1 = this.builder.options.subGraphs) === null || ref1 === void 0 ? void 0 : ref1.defaultForFields) {
var ref3;
subGraphs = ((ref3 = typeConfig.extensions) === null || ref3 === void 0 ? void 0 : ref3.subGraphs) || [];
} else if ((ref2 = this.builder.options.subGraphs) === null || ref2 === void 0 ? void 0 : ref2.defaultForFields) {
var ref4;
subGraphs = (ref4 = this.builder.options.subGraphs) === null || ref4 === void 0 ? void 0 : ref4.defaultForFields;
subGraphs = (ref3 = this.builder.options.subGraphs) === null || ref3 === void 0 ? void 0 : ref3.defaultForFields;
}

@@ -234,5 +237,4 @@ return {

}
exports.PothosSubGraphPlugin = PothosSubGraphPlugin;
_core.default.registerPlugin(pluginName, PothosSubGraphPlugin);
//# sourceMappingURL=index.js.map

@@ -5,4 +5,7 @@ "use strict";

});
exports.replaceType = replaceType;
var _graphql = require("graphql");
Object.defineProperty(exports, "replaceType", {
enumerable: true,
get: ()=>replaceType
});
const _graphql = require("graphql");
function replaceType(type, newTypes, referencedBy, subGraphs) {

@@ -9,0 +12,0 @@ if (type instanceof _graphql.GraphQLNonNull) {

{
"name": "@pothos/plugin-sub-graph",
"version": "3.5.0",
"version": "3.6.0",
"description": "A Pothos plugin for creating multiple variants or sub-selections of the same graph",

@@ -41,4 +41,4 @@ "main": "./lib/index.js",

"devDependencies": {
"@pothos/core": "3.11.0",
"@pothos/test-utils": "1.2.0",
"@pothos/core": "3.13.0",
"@pothos/test-utils": "1.3.0",
"graphql": "16.5.0",

@@ -45,0 +45,0 @@ "graphql-tag": "^2.12.6"

@@ -10,4 +10,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */

} from '@pothos/core';
import { PothosSubGraphPlugin } from '.';
import type { PothosSubGraphPlugin } from '.';
declare global {

@@ -14,0 +15,0 @@ export namespace PothosSchemaTypes {

{
"compilerOptions": {
"skipLibCheck": true,
"skipLibCheck": false
},

@@ -8,4 +8,4 @@ "extends": "../../tsconfig.options.json",

"src/**/*",
"tests/**/*",
"tests/**/*"
]
}
}

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

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