Skip to content

Commit ae97820

Browse files
committed
chore: update dependencies, make typescript definition changes introduces in graphql 16.1
1 parent b231b0c commit ae97820

File tree

17 files changed

+985
-952
lines changed

17 files changed

+985
-952
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ Variable Namings
293293

294294
describe('createOne', () => {
295295
it('should create child document without specifying DKey', async () => {
296-
const res = await graphql.graphql(
296+
const res = await graphql.graphql({
297297
schema,
298-
`mutation CreateCharacters {
298+
source: `mutation CreateCharacters {
299299
droidCreate(record: {name: "Queue XL", modelNumber: 360 }) {
300300
record {
301301
__typename

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@
3333
"mongoose": "^6.0.0 || ^5.0.0 || ^4.4.0"
3434
},
3535
"devDependencies": {
36-
"@types/jest": "27.0.1",
37-
"@typescript-eslint/eslint-plugin": "4.29.3",
38-
"@typescript-eslint/parser": "4.29.3",
39-
"eslint": "7.32.0",
40-
"eslint-config-airbnb-base": "14.2.1",
36+
"@types/jest": "27.0.3",
37+
"@typescript-eslint/eslint-plugin": "5.7.0",
38+
"@typescript-eslint/parser": "5.7.0",
39+
"eslint": "8.4.1",
40+
"eslint-config-airbnb-base": "15.0.0",
4141
"eslint-config-prettier": "8.3.0",
42-
"eslint-plugin-import": "2.24.2",
43-
"eslint-plugin-prettier": "3.4.1",
44-
"graphql": "15.5.1",
45-
"graphql-compose": "9.0.2",
46-
"jest": "27.1.0",
47-
"mongodb-memory-server": "7.3.6",
48-
"mongoose": "6.0.2",
49-
"prettier": "2.3.2",
42+
"eslint-plugin-import": "2.25.3",
43+
"eslint-plugin-prettier": "4.0.0",
44+
"graphql": "16.1.0",
45+
"graphql-compose": "9.0.5",
46+
"jest": "27.4.5",
47+
"mongodb-memory-server": "8.0.4",
48+
"mongoose": "6.1.2",
49+
"prettier": "2.5.1",
5050
"request": "2.88.2",
5151
"rimraf": "3.0.2",
52-
"semantic-release": "17.4.7",
53-
"ts-jest": "27.0.5",
54-
"typescript": "4.3.5"
52+
"semantic-release": "18.0.1",
53+
"ts-jest": "27.1.1",
54+
"typescript": "4.5.4"
5555
},
5656
"scripts": {
5757
"prepare": "tsc -p ./tsconfig.build.json",

src/__tests__/github_issues/219-test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,51 +50,51 @@ describe('issue #219 - Authorization using wrapResolve', () => {
5050
});
5151
const schema = schemaComposer.buildSchema();
5252
expect(
53-
await graphql.graphql(
53+
await graphql.graphql({
5454
schema,
55-
`query {
55+
source: `query {
5656
findUser(filter: { name: "AAAAA" }) {
5757
name
5858
age
5959
}
60-
}`
61-
)
60+
}`,
61+
})
6262
).toEqual({ data: { findUser: null } });
6363

6464
expect(
65-
await graphql.graphql(
65+
await graphql.graphql({
6666
schema,
67-
`query {
67+
source: `query {
6868
findUser(filter: { name: "BBBBB" }) {
6969
name
7070
age
7171
}
72-
}`
73-
)
72+
}`,
73+
})
7474
).toEqual({ data: { findUser: { age: 20, name: 'BBBBB' } } });
7575

7676
expect(
77-
await graphql.graphql(
77+
await graphql.graphql({
7878
schema,
79-
`query {
79+
source: `query {
8080
findUser(filter: { name: "CACHED" }) {
8181
name
8282
age
8383
}
84-
}`
85-
)
84+
}`,
85+
})
8686
).toEqual({ data: { findUser: { age: 99, name: 'CACHED' } } });
8787

8888
expect(
89-
await graphql.graphql(
89+
await graphql.graphql({
9090
schema,
91-
`query {
91+
source: `query {
9292
findUser(filter: { name: "ERROR" }) {
9393
name
9494
age
9595
}
96-
}`
97-
)
96+
}`,
97+
})
9898
).toEqual({ data: { findUser: null }, errors: [new Error('Wrong arg!')] });
9999
});
100100
});

src/__tests__/github_issues/250-test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,62 +43,62 @@ const schema = schemaComposer.buildSchema();
4343
describe('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
});

src/__tests__/github_issues/78-test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ describe('issue #78 - Mongoose and Discriminators', () => {
4444
types: [EventTC.getType(), ClickedLinkEventTC.getType()],
4545
resolveType: (value) => {
4646
if (value.kind === 'ClickedLinkEvent') {
47-
return ClickedLinkEventTC.getType();
47+
return ClickedLinkEventTC.getTypeName();
4848
}
49-
return EventTC.getType();
49+
return EventTC.getTypeName();
5050
},
5151
});
5252

@@ -64,21 +64,21 @@ describe('issue #78 - Mongoose and Discriminators', () => {
6464
});
6565
const schema = schemaComposer.buildSchema();
6666

67-
const res = await graphql.graphql(
67+
const res = await graphql.graphql({
6868
schema,
69-
`{
70-
eventFindMany {
71-
__typename
72-
... on GenericEvent {
73-
refId
69+
source: `{
70+
eventFindMany {
71+
__typename
72+
... on GenericEvent {
73+
refId
74+
}
75+
... on ClickedLinkEvent {
76+
refId
77+
url
78+
}
7479
}
75-
... on ClickedLinkEvent {
76-
refId
77-
url
78-
}
79-
}
80-
}`
81-
);
80+
}`,
81+
});
8282

8383
expect(res).toEqual({
8484
data: {

src/__tests__/github_issues/92-test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ describe('issue #92 - How to verify the fields?', () => {
2323
const schema = schemaComposer.buildSchema();
2424

2525
it('correct request', async () => {
26-
const result: any = await graphql.graphql(
26+
const result: any = await graphql.graphql({
2727
schema,
28-
`
28+
source: `
2929
mutation {
3030
addUser(record: { name: "User1", age: 30, contacts: { email: "1@1.com" } }) {
3131
record {
@@ -34,15 +34,15 @@ describe('issue #92 - How to verify the fields?', () => {
3434
}
3535
}
3636
}
37-
`
38-
);
37+
`,
38+
});
3939
expect(result).toEqual({ data: { addUser: { record: { age: 30, name: 'User1' } } } });
4040
});
4141

4242
it('wrong request', async () => {
43-
const result: any = await graphql.graphql(
43+
const result: any = await graphql.graphql({
4444
schema,
45-
`
45+
source: `
4646
mutation {
4747
addUser(record: { name: "User1", age: 10, contacts: { email: "1@1.com" } }) {
4848
record {
@@ -51,8 +51,8 @@ describe('issue #92 - How to verify the fields?', () => {
5151
}
5252
}
5353
}
54-
`
55-
);
54+
`,
55+
});
5656
expect(result).toEqual({ data: { addUser: null }, errors: expect.anything() });
5757
expect(result.errors[0].message).toBe('You are too young');
5858
});

src/__tests__/github_issues/93-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ describe('issue #93', () => {
3737
contacts: { email: '3@3.com' },
3838
});
3939

40-
const res = await graphql.graphql(
40+
const res = await graphql.graphql({
4141
schema,
42-
`
42+
source: `
4343
{
4444
users(filter: { OR: [{ age: 301 }, { AND: [{ gender: male }, { age: 302 }] }] }) {
4545
name
4646
}
4747
}
48-
`
49-
);
48+
`,
49+
});
5050
expect(res).toEqual({ data: { users: [{ name: 'User301' }, { name: 'User302' }] } });
5151
});
5252
});

src/__tests__/github_issues/gc282-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ afterAll(() => EventModel.base.disconnect());
6565
describe('graphql-compose/issue #282 - Filter nested array by string', () => {
6666
it('correct request', async () => {
6767
expect(
68-
await graphql.graphql(
68+
await graphql.graphql({
6969
schema,
70-
`query {
70+
source: `query {
7171
eventMany(filter: { subjects: ["notMetaValue"] }) {
7272
message
7373
meta {
7474
subjects
7575
}
7676
}
77-
}`
78-
)
77+
}`,
78+
})
7979
).toEqual({
8080
data: { eventMany: [{ message: 'event2', meta: { subjects: ['notMetaValue'] } }] },
8181
});

0 commit comments

Comments
 (0)