@@ -43,62 +43,62 @@ const schema = schemaComposer.buildSchema();
4343describe ( 'issue #250 - Adds support for nested `_operators`, add `exists`, `regex` operators' , ( ) => {
4444 it ( 'check `exist` operator' , async ( ) => {
4545 expect (
46- await graphql . graphql (
46+ await graphql . graphql ( {
4747 schema,
48- `query {
48+ source : `query {
4949 findMany(filter: { _operators: { gender: { exists: true } } }) {
5050 name
5151 gender
5252 }
53- }`
54- )
53+ }` ,
54+ } )
5555 ) . toEqual ( { data : { findMany : [ { gender : 'male' , name : 'BBBBB' } ] } } ) ;
5656 } ) ;
5757
5858 it ( 'check nested `exist` operator' , async ( ) => {
5959 expect (
60- await graphql . graphql (
60+ await graphql . graphql ( {
6161 schema,
62- `query {
62+ source : `query {
6363 findMany(filter: { _operators: { contacts: { skype: { exists: true } } } }) {
6464 name
6565 }
66- }`
67- )
66+ }` ,
67+ } )
6868 ) . toEqual ( { data : { findMany : [ { name : 'BBBBB' } ] } } ) ;
6969 } ) ;
7070
7171 it ( 'check `regex` operator' , async ( ) => {
7272 expect (
73- await graphql . graphql (
73+ await graphql . graphql ( {
7474 schema,
75- `query {
75+ source : `query {
7676 findMany(filter: { _operators: { name: { regex: "^AA|CC.*" } } }) {
7777 name
7878 }
79- }`
80- )
79+ }` ,
80+ } )
8181 ) . toEqual ( { data : { findMany : [ { name : 'AAAAA' } , { name : 'CCCCC' } ] } } ) ;
8282 } ) ;
8383
8484 it ( 'check nested `regex` operator' , async ( ) => {
8585 expect (
86- await graphql . graphql (
86+ await graphql . graphql ( {
8787 schema,
88- `query {
88+ source : `query {
8989 findMany(filter: { _operators: { contacts: { email: { regex: "/3.COM/i" } } } }) {
9090 name
9191 }
92- }`
93- )
92+ }` ,
93+ } )
9494 ) . toEqual ( { data : { findMany : [ { name : 'CCCCC' } ] } } ) ;
9595 } ) ;
9696
9797 it ( 'check combined nested `regex` operator' , async ( ) => {
9898 expect (
99- await graphql . graphql (
99+ await graphql . graphql ( {
100100 schema,
101- `query {
101+ source : `query {
102102 findMany(
103103 filter: { OR: [
104104 { _operators: { contacts: { email: { regex: "/3.COM/i" } } } },
@@ -107,8 +107,8 @@ describe('issue #250 - Adds support for nested `_operators`, add `exists`, `rege
107107 ) {
108108 name
109109 }
110- }`
111- )
110+ }` ,
111+ } )
112112 ) . toEqual ( { data : { findMany : [ { name : 'BBBBB' } , { name : 'CCCCC' } ] } } ) ;
113113 } ) ;
114114} ) ;
0 commit comments