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

graphql-fields

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-fields - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

23

build/index.js

@@ -32,7 +32,5 @@ 'use strict';

function getArguments(ast) {
function getArguments(ast, info) {
return ast.arguments.map(function (argument) {
var argumentValue = argument.value.kind !== 'ListValue' ? argument.value.value : argument.value.values.map(function (value) {
return value.value;
});
var argumentValue = getArgumentValue(argument.value, info);
return _defineProperty({}, argument.name.value, {

@@ -45,2 +43,17 @@ kind: argument.value.kind,

function getArgumentValue(arg, info) {
switch (arg.kind) {
case 'Variable':
return info.variableValues[arg.name.value];
case 'ListValue':
return arg.values.map(function (argument) {
return getArgumentValue(argument, info);
});
default:
return arg.value;
}
}
function getDirectiveValue(directive, info) {

@@ -113,3 +126,3 @@ var arg = directive.arguments[0]; // only arg on an include or skip directive is "if"

_extends(flattened[name], {
__arguments: getArguments(a)
__arguments: getArguments(a, info)
});

@@ -116,0 +129,0 @@ }

# Changelog
## 2.0.2 (2019-02-28)
### Fixed
- process arguments passed as variables
## 2.0.1 (2018-12-04)

@@ -4,0 +11,0 @@

{
"name": "graphql-fields",
"version": "2.0.1",
"version": "2.0.2",
"description": "Turns GraphQLResolveInfo into a map of the requested fields",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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