File tree Expand file tree Collapse file tree 5 files changed +621
-591
lines changed Expand file tree Collapse file tree 5 files changed +621
-591
lines changed Original file line number Diff line number Diff line change 19
19
"devDependencies" : {
20
20
"@types/dedent" : " 0.7.0" ,
21
21
"@types/glob" : " 7.1.1" ,
22
- "@types/jest" : " 25.1.2 " ,
23
- "@types/node" : " 13.7.1 " ,
24
- "@typescript-eslint/eslint-plugin" : " 2.19.2 " ,
25
- "@typescript-eslint/parser" : " 2.19.2 " ,
26
- "apollo-server" : " 2.10.1 " ,
22
+ "@types/jest" : " 25.2.1 " ,
23
+ "@types/node" : " 13.11.0 " ,
24
+ "@typescript-eslint/eslint-plugin" : " 2.26.0 " ,
25
+ "@typescript-eslint/parser" : " 2.26.0 " ,
26
+ "apollo-server" : " 2.11.0 " ,
27
27
"eslint" : " 6.8.0" ,
28
- "eslint-config-prettier" : " 6.10.0 " ,
28
+ "eslint-config-prettier" : " 6.10.1 " ,
29
29
"eslint-plugin-prettier" : " 3.1.2" ,
30
- "graphql" : " 14.6 .0" ,
31
- "graphql-compose" : " 7.12.0 " ,
32
- "jest" : " 25.1.0 " ,
33
- "prettier" : " 1.19.1 " ,
30
+ "graphql" : " 15.0 .0" ,
31
+ "graphql-compose" : " 7.14.1 " ,
32
+ "jest" : " 25.2.7 " ,
33
+ "prettier" : " 2.0.2 " ,
34
34
"rimraf" : " 3.0.2" ,
35
- "semantic-release" : " 17.0.3 " ,
36
- "ts-jest" : " 25.2.0 " ,
37
- "ts-node" : " 8.6 .2" ,
38
- "typescript" : " 3.7.5 "
35
+ "semantic-release" : " 17.0.4 " ,
36
+ "ts-jest" : " 25.3.1 " ,
37
+ "ts-node" : " 8.8 .2" ,
38
+ "typescript" : " 3.8.3 "
39
39
},
40
40
"scripts" : {
41
41
"watch" : " jest --watch" ,
Original file line number Diff line number Diff line change 1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` astToSchema() Schema ./__testSchema__ schema 1` ] = `
4
- "type Mutation {
5
- logs : MutationLogs
6
- auth : MutationAuth
7
- user : MutationUser
8
- }
9
-
10
- type MutationAuth {
11
- # Login operation
12
- login (email : String , password : String ): Boolean
13
- logout : Boolean
14
- nested : MutationAuthNested
15
- }
16
-
17
- type MutationAuthNested {
18
- method : Boolean
19
- }
20
-
21
- type MutationLogs {
22
- nested : MutationLogsNested
23
- }
24
-
25
- type MutationLogsNested {
26
- list : Boolean
27
- }
28
-
29
- type MutationUser {
30
- create : Boolean
31
- update : Boolean
4
+ "\\ "\\ "\\ "\\ "\\ "\\ "
5
+ schema {
6
+ query : Query
7
+ mutation : Mutation
32
8
}
33
9
34
10
type Query {
@@ -39,15 +15,6 @@ type Query {
39
15
auth : QueryAuth
40
16
}
41
17
42
- type QueryAuth {
43
- isLoggedIn : Boolean
44
- nested : QueryAuthNested
45
- }
46
-
47
- type QueryAuthNested {
48
- method : Boolean
49
- }
50
-
51
18
type QueryMe {
52
19
address : QueryMeAddress
53
20
name : String
@@ -77,5 +44,44 @@ type UserAwesomeType {
77
44
type UserExtendedData {
78
45
starsCount : Int
79
46
}
47
+
48
+ type QueryAuth {
49
+ isLoggedIn : Boolean
50
+ nested : QueryAuthNested
51
+ }
52
+
53
+ type QueryAuthNested {
54
+ method : Boolean
55
+ }
56
+
57
+ type Mutation {
58
+ logs : MutationLogs
59
+ auth : MutationAuth
60
+ user : MutationUser
61
+ }
62
+
63
+ type MutationLogs {
64
+ nested : MutationLogsNested
65
+ }
66
+
67
+ type MutationLogsNested {
68
+ list : Boolean
69
+ }
70
+
71
+ type MutationAuth {
72
+ # Login operation
73
+ login (email : String , password : String ): Boolean
74
+ logout : Boolean
75
+ nested : MutationAuthNested
76
+ }
77
+
78
+ type MutationAuthNested {
79
+ method : Boolean
80
+ }
81
+
82
+ type MutationUser {
83
+ create : Boolean
84
+ update : Boolean
85
+ }
80
86
"
81
87
` ;
Original file line number Diff line number Diff line change @@ -85,17 +85,13 @@ describe('astToSchema()', () => {
85
85
// check that fields from sibling files was added
86
86
expect ( sc . Query . getFieldOTC ( 'me' ) . getFieldTypeName ( 'name' ) ) . toBe ( 'String' ) ;
87
87
expect ( ( sc . Query . getFieldOTC ( 'me' ) . getFieldConfig ( 'name' ) as any ) . resolve ( ) ) . toBe ( 'nodkz' ) ;
88
- expect (
89
- sc . Query . getFieldOTC ( 'me' )
90
- . getFieldOTC ( 'address' )
91
- . getTypeName ( )
92
- ) . toBe ( 'QueryMeAddress' ) ;
93
- expect (
94
- sc . Query . getFieldOTC ( 'me' )
95
- . getFieldOTC ( 'address' )
96
- . getFieldNames ( )
97
- . sort ( )
98
- ) . toEqual ( [ 'city' , 'street' ] ) ;
88
+ expect ( sc . Query . getFieldOTC ( 'me' ) . getFieldOTC ( 'address' ) . getTypeName ( ) ) . toBe (
89
+ 'QueryMeAddress'
90
+ ) ;
91
+ expect ( sc . Query . getFieldOTC ( 'me' ) . getFieldOTC ( 'address' ) . getFieldNames ( ) . sort ( ) ) . toEqual ( [
92
+ 'city' ,
93
+ 'street' ,
94
+ ] ) ;
99
95
} ) ;
100
96
} ) ;
101
97
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function _getArgsForQuery(
82
82
} ;
83
83
}
84
84
85
- export async function testOperation ( opts : RunQueryOpts ) : Promise < ExecutionResult < any > > {
85
+ export async function testOperation ( opts : RunQueryOpts ) : Promise < ExecutionResult > {
86
86
const schema = testBuildSchema ( opts . fc , opts . schemaComposer ) ;
87
87
88
88
const res = await graphql ( {
You can’t perform that action at this time.
0 commit comments