graphql-subscriptions
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -5,2 +5,5 @@ # Changelog | ||
### 0.5.1 | ||
- `withFilter` now called with `(rootValue, args, context, info)` [PR #103] (https://github.com/apollographql/graphql-subscriptions/pull/103) | ||
### 0.5.0 | ||
@@ -7,0 +10,0 @@ - BREAKING CHANGE: Removed deprecated code. [PR #104] (https://github.com/apollographql/graphql-subscriptions/pull/104) |
export declare type FilterFn = (rootValue?: any, args?: any, context?: any, info?: any) => boolean; | ||
export declare type ResolverFn = (rootValue?: any, args?: any, context?: any, info?: any) => AsyncIterator<any>; | ||
export declare const withFilter: (asyncIteratorFn: () => AsyncIterator<any>, filterFn: FilterFn) => Function; | ||
export declare const withFilter: (asyncIteratorFn: ResolverFn, filterFn: FilterFn) => Function; |
@@ -6,3 +6,3 @@ "use strict"; | ||
return function (rootValue, args, context, info) { | ||
var asyncIterator = asyncIteratorFn(); | ||
var asyncIterator = asyncIteratorFn(rootValue, args, context, info); | ||
var getNextPromise = function () { | ||
@@ -9,0 +9,0 @@ return asyncIterator |
{ | ||
"name": "graphql-subscriptions", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "GraphQL subscriptions for node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -78,3 +78,3 @@ [![npm version](https://badge.fury.io/js/graphql-subscriptions.svg)](https://badge.fury.io/js/graphql-subscriptions) [![GitHub license](https://img.shields.io/github/license/apollostack/graphql-subscriptions.svg)](https://github.com/apollostack/graphql-subscriptions/blob/license/LICENSE) | ||
`withFilter` API: | ||
- `asyncIteratorFn: () => AsyncIterator<any>` : A function that returns `AsyncIterator` you got from your `pubsub.asyncIterator`. | ||
- `asyncIteratorFn: (rootValue, args, context, info) => AsyncIterator<any>` : A function that returns `AsyncIterator` you got from your `pubsub.asyncIterator`. | ||
- `filterFn: (payload, variables, context, info) => boolean | Promise<boolean>` - A filter function, executed with the payload (the published value), variables, context and operation info, must return `boolean` or `Promise<boolean>` indicating if the payload should pass to the subscriber. | ||
@@ -81,0 +81,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
163758
43
777