File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/__tests__/github_issues Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ /* @flow */
2+
3+ import { schemaComposer , InputTypeComposer } from 'graphql-compose' ;
4+ import {
5+ processFilterOperators ,
6+ OPERATORS_FIELDNAME ,
7+ } from '../../resolvers/helpers/filterOperators' ;
8+
9+ let itc : InputTypeComposer < any > ;
10+
11+ beforeEach ( ( ) => {
12+ schemaComposer . clear ( ) ;
13+ itc = schemaComposer . createInputTC ( {
14+ name : 'UserFilterInput' ,
15+ fields : {
16+ _id : 'String' ,
17+ employment : 'String' ,
18+ name : 'String' ,
19+ age : 'Int' ,
20+ skills : [ 'String' ] ,
21+ } ,
22+ } ) ;
23+ } ) ;
24+
25+ describe ( `issue #181 - Cannot read property '_operators' of null` , ( ) => {
26+ it ( 'should call query.find if operator value is null' , ( ) => {
27+ const filter = {
28+ [ OPERATORS_FIELDNAME ] : { age : { ne : null } } ,
29+ } ;
30+ expect ( processFilterOperators ( filter ) ) . toEqual ( { age : { $ne : null } } ) ;
31+ } ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments