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

graphql-query-rewriter-rc

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-query-rewriter-rc - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

26

dist/index.es5.js

@@ -893,3 +893,9 @@ import { Kind, parse, print, isValueNode, parseType } from 'graphql';

if (this.newFieldName) {
Object.assign(node.name, { value: this.newFieldName });
var newName = this.newFieldName;
if (this.newFieldName.includes(':')) {
var _a = this.newFieldName.split(':'), alias = _a[0], name_1 = _a[1];
newName = name_1.trim();
Object.assign(node, { alias: { value: alias.trim(), kind: Kind.NAME } });
}
Object.assign(node.name, { value: newName });
}

@@ -940,8 +946,16 @@ // if there's the intention of converting the field to a subselection

// and pass the new key (field name) down.
if (key === this.newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
if (this.newFieldName) {
var newFieldName = this.newFieldName;
// the newFieldName may be alised.
if (this.newFieldName.includes(':')) {
var alias = this.newFieldName.split(':')[0];
newFieldName = alias.trim();
}
if (key === newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
}
}
}

@@ -948,0 +962,0 @@ // Undo the nesting in the response so it matches the original query

@@ -897,3 +897,9 @@ (function (global, factory) {

if (this.newFieldName) {
Object.assign(node.name, { value: this.newFieldName });
var newName = this.newFieldName;
if (this.newFieldName.includes(':')) {
var _a = this.newFieldName.split(':'), alias = _a[0], name_1 = _a[1];
newName = name_1.trim();
Object.assign(node, { alias: { value: alias.trim(), kind: graphql.Kind.NAME } });
}
Object.assign(node.name, { value: newName });
}

@@ -944,8 +950,16 @@ // if there's the intention of converting the field to a subselection

// and pass the new key (field name) down.
if (key === this.newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
if (this.newFieldName) {
var newFieldName = this.newFieldName;
// the newFieldName may be alised.
if (this.newFieldName.includes(':')) {
var alias = this.newFieldName.split(':')[0];
newFieldName = alias.trim();
}
if (key === newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
}
}
}

@@ -952,0 +966,0 @@ // Undo the nesting in the response so it matches the original query

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var graphql_1 = require("graphql");
var ast_1 = require("../ast");

@@ -51,3 +52,9 @@ var Rewriter_1 = require("./Rewriter");

if (this.newFieldName) {
Object.assign(node.name, { value: this.newFieldName });
var newName = this.newFieldName;
if (this.newFieldName.includes(':')) {
var _a = this.newFieldName.split(':'), alias = _a[0], name_1 = _a[1];
newName = name_1.trim();
Object.assign(node, { alias: { value: alias.trim(), kind: graphql_1.Kind.NAME } });
}
Object.assign(node.name, { value: newName });
}

@@ -98,8 +105,16 @@ // if there's the intention of converting the field to a subselection

// and pass the new key (field name) down.
if (key === this.newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
if (this.newFieldName) {
var newFieldName = this.newFieldName;
// the newFieldName may be alised.
if (this.newFieldName.includes(':')) {
var alias = this.newFieldName.split(':')[0];
newFieldName = alias.trim();
}
if (key === newFieldName) {
if (this.fieldName) {
originalKey = this.fieldName;
Object.assign(response, (_a = {}, _a[originalKey] = response[key], _a));
delete response[key];
}
}
}

@@ -106,0 +121,0 @@ // Undo the nesting in the response so it matches the original query

{
"name": "graphql-query-rewriter-rc",
"version": "0.0.9",
"version": "0.0.10",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [],

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