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

graphql-resolve

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-resolve - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/index.js.flow

6

gulpfile.js

@@ -16,7 +16,3 @@ const { argv } = require('yargs');

'test',
[
'transpile',
],
['transpile'],
() => gulp.src([

@@ -23,0 +19,0 @@ 'src/**/test/**/*.unit.js',

@@ -42,2 +42,3 @@ 'use strict';

};
var promisifyNext = exports.promisifyNext = function promisifyNext(next) {

@@ -44,0 +45,0 @@ return function (parent, args, context, ast) {

{
"name": "graphql-resolve",
"version": "0.0.2",
"version": "0.0.3",
"description": "Hook into each resolve method on a GraphQL schema",

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

@@ -9,9 +9,9 @@ # graphql-resolve

const intercept = next => (p, a, c, ast) => {
return promisifyNext(next)(p, a, c, ast);
const intercept = next => (parent, args, context, ast) => {
return promisifyNext(next)(parent, args, context, ast);
};
wrapResolve(schema, (field, type) => {
graphqlResolve(schema, (field, type) => {
field.resolve = intercept(field.resolve || defaultNext);
});
```
// @flow
import type { GraphQLSchema } from 'graphql';
import _ from 'lodash';

@@ -7,5 +9,5 @@ import Promise from 'bluebird';

type Parent = *;
type Args = *;
type Context = *;
type Ast = *;
type Args = Object;
type Context = Object;
type Ast = { fieldName:string };

@@ -38,3 +40,3 @@ export const defaultNext = (

export default function (
schema:*,
schema:GraphQLSchema,
cb:(field:*, type:GraphQLObjectType) => *,

@@ -46,3 +48,3 @@ ) {

.filter(type => type instanceof GraphQLObjectType)
.forEach((type:GraphQLObjectType) => {
.forEach((type:any) => {
const fields = type.getFields();

@@ -49,0 +51,0 @@ Object.keys(fields).forEach((fieldName) => {

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