@subsquid/openreader 4.6.0 → 5.0.0-beta.79d2fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context.d.ts +2 -2
- package/lib/context.d.ts.map +1 -1
- package/lib/db.d.ts +3 -3
- package/lib/db.d.ts.map +1 -1
- package/lib/db.js +2 -2
- package/lib/db.js.map +1 -1
- package/lib/dialect/common.d.ts +19 -0
- package/lib/dialect/common.d.ts.map +1 -0
- package/lib/dialect/common.js +42 -0
- package/lib/dialect/common.js.map +1 -0
- package/lib/dialect/index.d.ts +6 -0
- package/lib/dialect/index.d.ts.map +1 -0
- package/lib/dialect/index.js +49 -0
- package/lib/dialect/index.js.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/orderBy.d.ts +2 -3
- package/lib/dialect/opencrud/orderBy.d.ts.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/orderBy.js +4 -21
- package/lib/dialect/opencrud/orderBy.js.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/schema.d.ts +2 -6
- package/lib/dialect/opencrud/schema.d.ts.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/schema.js +21 -34
- package/lib/dialect/opencrud/schema.js.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/tree.d.ts +3 -3
- package/lib/dialect/opencrud/tree.d.ts.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/tree.js +3 -3
- package/lib/dialect/opencrud/tree.js.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/where.d.ts +1 -1
- package/lib/dialect/opencrud/where.d.ts.map +1 -0
- package/lib/{opencrud → dialect/opencrud}/where.js +4 -13
- package/lib/dialect/opencrud/where.js.map +1 -0
- package/lib/dialect/thegraph/locale.d.ts +2 -0
- package/lib/dialect/thegraph/locale.d.ts.map +1 -0
- package/lib/dialect/thegraph/locale.js +49 -0
- package/lib/dialect/thegraph/locale.js.map +1 -0
- package/lib/dialect/thegraph/orderBy.d.ts +11 -0
- package/lib/dialect/thegraph/orderBy.d.ts.map +1 -0
- package/lib/dialect/thegraph/orderBy.js +71 -0
- package/lib/dialect/thegraph/orderBy.js.map +1 -0
- package/lib/dialect/thegraph/schema.d.ts +25 -0
- package/lib/dialect/thegraph/schema.d.ts.map +1 -0
- package/lib/dialect/thegraph/schema.js +429 -0
- package/lib/dialect/thegraph/schema.js.map +1 -0
- package/lib/dialect/thegraph/tree.d.ts +10 -0
- package/lib/dialect/thegraph/tree.d.ts.map +1 -0
- package/lib/dialect/thegraph/tree.js +148 -0
- package/lib/dialect/thegraph/tree.js.map +1 -0
- package/lib/dialect/thegraph/where.d.ts +9 -0
- package/lib/dialect/thegraph/where.d.ts.map +1 -0
- package/lib/dialect/thegraph/where.js +198 -0
- package/lib/dialect/thegraph/where.js.map +1 -0
- package/lib/ir/args.d.ts +1 -1
- package/lib/ir/args.d.ts.map +1 -1
- package/lib/main.js +1 -1
- package/lib/main.js.map +1 -1
- package/lib/model.d.ts +2 -0
- package/lib/model.d.ts.map +1 -1
- package/lib/model.schema.d.ts.map +1 -1
- package/lib/model.schema.js +31 -2
- package/lib/model.schema.js.map +1 -1
- package/lib/server.d.ts +3 -1
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +7 -6
- package/lib/server.js.map +1 -1
- package/lib/sql/cursor.d.ts +2 -2
- package/lib/sql/cursor.d.ts.map +1 -1
- package/lib/sql/cursor.js +2 -2
- package/lib/sql/cursor.js.map +1 -1
- package/lib/sql/printer.d.ts +3 -3
- package/lib/sql/printer.d.ts.map +1 -1
- package/lib/sql/printer.js +17 -15
- package/lib/sql/printer.js.map +1 -1
- package/lib/sql/query.d.ts +5 -5
- package/lib/sql/query.d.ts.map +1 -1
- package/lib/sql/query.js.map +1 -1
- package/lib/sql/util.d.ts +2 -2
- package/lib/sql/util.d.ts.map +1 -1
- package/lib/sql/util.js.map +1 -1
- package/lib/test/basic.test.js +471 -229
- package/lib/test/basic.test.js.map +1 -1
- package/lib/test/isNull.test.js +87 -36
- package/lib/test/isNull.test.js.map +1 -1
- package/lib/test/limits.test.js +206 -94
- package/lib/test/limits.test.js.map +1 -1
- package/lib/test/lookup.test.js +184 -81
- package/lib/test/lookup.test.js.map +1 -1
- package/lib/test/setup.js +2 -2
- package/lib/test/setup.js.map +1 -1
- package/lib/test/where.test.js +216 -99
- package/lib/test/where.test.js.map +1 -1
- package/package.json +5 -3
- package/src/context.ts +2 -2
- package/src/db.ts +4 -2
- package/src/dialect/common.ts +49 -0
- package/src/dialect/index.ts +20 -0
- package/src/{opencrud → dialect/opencrud}/orderBy.ts +4 -21
- package/src/{opencrud → dialect/opencrud}/schema.ts +30 -55
- package/src/{opencrud → dialect/opencrud}/tree.ts +6 -7
- package/src/{opencrud → dialect/opencrud}/where.ts +4 -16
- package/src/dialect/thegraph/locale.ts +284 -0
- package/src/dialect/thegraph/orderBy.ts +75 -0
- package/src/dialect/thegraph/schema.ts +484 -0
- package/src/dialect/thegraph/tree.ts +162 -0
- package/src/dialect/thegraph/where.ts +192 -0
- package/src/ir/args.ts +2 -0
- package/src/main.ts +3 -3
- package/src/model.schema.ts +37 -4
- package/src/model.ts +2 -0
- package/src/server.ts +21 -19
- package/src/sql/cursor.ts +4 -4
- package/src/sql/printer.ts +22 -18
- package/src/sql/query.ts +5 -5
- package/src/sql/util.ts +2 -2
- package/src/test/basic.test.ts +570 -282
- package/src/test/isNull.test.ts +95 -38
- package/src/test/limits.test.ts +212 -91
- package/src/test/lookup.test.ts +190 -83
- package/src/test/setup.ts +2 -2
- package/src/test/where.test.ts +235 -108
- package/lib/dialect.d.ts +0 -2
- package/lib/dialect.d.ts.map +0 -1
- package/lib/dialect.js +0 -3
- package/lib/dialect.js.map +0 -1
- package/lib/opencrud/orderBy.d.ts.map +0 -1
- package/lib/opencrud/orderBy.js.map +0 -1
- package/lib/opencrud/schema.d.ts.map +0 -1
- package/lib/opencrud/schema.js.map +0 -1
- package/lib/opencrud/tree.d.ts.map +0 -1
- package/lib/opencrud/tree.js.map +0 -1
- package/lib/opencrud/where.d.ts.map +0 -1
- package/lib/opencrud/where.js.map +0 -1
- package/src/dialect.ts +0 -2
package/src/test/isNull.test.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {Dialect} from '../dialect'
|
|
1
2
|
import {useDatabase, useServer} from "./setup"
|
|
2
3
|
|
|
3
4
|
|
|
@@ -12,7 +13,7 @@ describe('isNull operator', function() {
|
|
|
12
13
|
`insert into entity (id, scalar, json, meta_id) values ('4', 'foo', '{}', '1')`,
|
|
13
14
|
])
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const schema = `
|
|
16
17
|
type Meta @entity {
|
|
17
18
|
id: ID!
|
|
18
19
|
}
|
|
@@ -27,53 +28,109 @@ describe('isNull operator', function() {
|
|
|
27
28
|
type JsonObject {
|
|
28
29
|
a: Int
|
|
29
30
|
}
|
|
30
|
-
`
|
|
31
|
+
`
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
describe(Dialect.OpenCrud, function() {
|
|
34
|
+
const client = useServer(schema)
|
|
35
|
+
|
|
36
|
+
it("on scalar", function() {
|
|
37
|
+
return client.test(`
|
|
38
|
+
query {
|
|
39
|
+
entities(where: {scalar_isNull: true}) {
|
|
40
|
+
id
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
`, {
|
|
44
|
+
entities: [{id: '1'}]
|
|
45
|
+
})
|
|
41
46
|
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
it("on json", function() {
|
|
49
|
+
return client.test(`
|
|
50
|
+
query {
|
|
51
|
+
entities(where: {json_isNull: true}) {
|
|
52
|
+
id
|
|
53
|
+
}
|
|
49
54
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
`, {
|
|
56
|
+
entities: [{id: '2'}]
|
|
57
|
+
})
|
|
53
58
|
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
|
|
60
|
+
it("on nested json prop", function() {
|
|
61
|
+
return client.test(`
|
|
62
|
+
query {
|
|
63
|
+
entities(where: {json: {a_isNull: true}} orderBy: id_ASC) {
|
|
64
|
+
id
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`, {
|
|
68
|
+
entities: [{id: '2'}, {id: '4'}]
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it("on fk", function() {
|
|
73
|
+
return client.test(`
|
|
74
|
+
query {
|
|
75
|
+
entities(where: {meta_isNull: true}) {
|
|
76
|
+
id
|
|
77
|
+
}
|
|
61
78
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
79
|
+
`, {
|
|
80
|
+
entities: [{id: '3'}]
|
|
81
|
+
})
|
|
65
82
|
})
|
|
66
83
|
})
|
|
67
84
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
describe(Dialect.TheGraph, function() {
|
|
86
|
+
const client = useServer(schema, {dialect: Dialect.TheGraph})
|
|
87
|
+
|
|
88
|
+
it("on scalar", function() {
|
|
89
|
+
return client.test(`
|
|
90
|
+
query {
|
|
91
|
+
entities(where: {scalar_is_null: true}) {
|
|
92
|
+
id
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`, {
|
|
96
|
+
entities: [{id: '1'}]
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it("on json", function() {
|
|
101
|
+
return client.test(`
|
|
102
|
+
query {
|
|
103
|
+
entities(where: {json_is_null: true}) {
|
|
104
|
+
id
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`, {
|
|
108
|
+
entities: [{id: '2'}]
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("on nested json prop", function() {
|
|
113
|
+
return client.test(`
|
|
114
|
+
query {
|
|
115
|
+
entities(where: {json_: {a_is_null: true}} orderBy: id, orderDirection: asc) {
|
|
116
|
+
id
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`, {
|
|
120
|
+
entities: [{id: '2'}, {id: '4'}]
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it("on fk", function() {
|
|
125
|
+
return client.test(`
|
|
126
|
+
query {
|
|
127
|
+
entities(where: {meta_is_null: true}) {
|
|
128
|
+
id
|
|
129
|
+
}
|
|
73
130
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
131
|
+
`, {
|
|
132
|
+
entities: [{id: '3'}]
|
|
133
|
+
})
|
|
77
134
|
})
|
|
78
135
|
})
|
|
79
136
|
})
|
package/src/test/limits.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import expect from 'expect'
|
|
2
2
|
import {useDatabase, useServer} from './setup'
|
|
3
|
+
import {Dialect} from '../dialect'
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
describe('response size limits', function() {
|
|
@@ -12,7 +13,7 @@ describe('response size limits', function() {
|
|
|
12
13
|
`create table item3 (id text primary key, order_id text, name text)`,
|
|
13
14
|
])
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
let schema = `
|
|
16
17
|
type Order1 @entity {
|
|
17
18
|
id: ID!
|
|
18
19
|
items: [Item1!]! @derivedFrom(field: "order")
|
|
@@ -45,119 +46,239 @@ describe('response size limits', function() {
|
|
|
45
46
|
order: Order3!
|
|
46
47
|
name: String @byteWeight(value: 10.0)
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
`
|
|
50
|
+
let opts = {
|
|
49
51
|
maxResponseNodes: 50,
|
|
50
52
|
maxRootFields: 3
|
|
51
|
-
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe(Dialect.OpenCrud, function() {
|
|
56
|
+
const client = useServer(schema, opts)
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
it('unlimited requests fail', async function() {
|
|
59
|
+
let result = await client.query(`
|
|
60
|
+
query {
|
|
61
|
+
order1s {
|
|
62
|
+
id
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`)
|
|
66
|
+
expect(result).toMatchObject({
|
|
67
|
+
data: null,
|
|
68
|
+
errors: [
|
|
69
|
+
expect.objectContaining({message: 'response might exceed the size limit', path: ['order1s']})
|
|
70
|
+
]
|
|
71
|
+
})
|
|
66
72
|
})
|
|
67
|
-
})
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
it('limited requests work', function() {
|
|
75
|
+
return client.test(`
|
|
76
|
+
query {
|
|
77
|
+
order1s(limit: 10) {
|
|
78
|
+
items(limit: 2) {
|
|
79
|
+
id
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`, {
|
|
84
|
+
order1s: []
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('entity level cardinalities are respected', function() {
|
|
89
|
+
return client.test(`
|
|
90
|
+
query {
|
|
91
|
+
order2s {
|
|
74
92
|
id
|
|
75
93
|
}
|
|
76
94
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
`, {
|
|
96
|
+
order2s: []
|
|
97
|
+
})
|
|
80
98
|
})
|
|
81
|
-
})
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
100
|
+
it('item cardinalities are respected', function() {
|
|
101
|
+
return client.test(`
|
|
102
|
+
query {
|
|
103
|
+
order3s(limit: 1) {
|
|
104
|
+
items { id }
|
|
105
|
+
}
|
|
88
106
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
`, {
|
|
108
|
+
order3s: []
|
|
109
|
+
})
|
|
92
110
|
})
|
|
93
|
-
})
|
|
94
111
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
it('@byteWeight annotations are respected', async function() {
|
|
113
|
+
let result = await client.query(`
|
|
114
|
+
query {
|
|
115
|
+
order3s(limit: 1) {
|
|
116
|
+
items(limit: 8) { name }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`)
|
|
120
|
+
expect(result).toEqual({
|
|
121
|
+
data: null,
|
|
122
|
+
errors: [
|
|
123
|
+
expect.objectContaining({
|
|
124
|
+
message: 'response might exceed the size limit',
|
|
125
|
+
path: ['order3s']
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
await client.test(`
|
|
130
|
+
query {
|
|
131
|
+
order3s(limit: 1) {
|
|
132
|
+
items(limit: 4) { name }
|
|
133
|
+
}
|
|
100
134
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
135
|
+
`, {
|
|
136
|
+
order3s: []
|
|
137
|
+
})
|
|
104
138
|
})
|
|
105
|
-
})
|
|
106
139
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
errors: [
|
|
118
|
-
expect.objectContaining({
|
|
119
|
-
message: 'response might exceed the size limit',
|
|
120
|
-
path: ['order3s']
|
|
121
|
-
})
|
|
122
|
-
]
|
|
140
|
+
it('id_in conditions are understood', function() {
|
|
141
|
+
return client.test(`
|
|
142
|
+
query {
|
|
143
|
+
order1s(where: {id_in: ["1", "2", "3"]}) {
|
|
144
|
+
id
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`, {
|
|
148
|
+
order1s: []
|
|
149
|
+
})
|
|
123
150
|
})
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
151
|
+
|
|
152
|
+
it('root query fields limit', async function() {
|
|
153
|
+
return client.httpErrorTest(`
|
|
154
|
+
query {
|
|
155
|
+
a: order1ById(id: "1") { id }
|
|
156
|
+
b: order1ById(id: "1") { id }
|
|
157
|
+
c: order1ById(id: "1") { id }
|
|
158
|
+
d: order1ById(id: "1") { id }
|
|
159
|
+
}
|
|
160
|
+
`, {
|
|
161
|
+
errors: [
|
|
162
|
+
expect.objectContaining({
|
|
163
|
+
message: 'only 3 root fields allowed, but got 4'
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
})
|
|
132
167
|
})
|
|
133
168
|
})
|
|
134
169
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
170
|
+
describe(Dialect.TheGraph, function() {
|
|
171
|
+
const client = useServer(schema, {...opts, dialect: Dialect.TheGraph})
|
|
172
|
+
|
|
173
|
+
it('unlimited requests fail', async function() {
|
|
174
|
+
let result = await client.query(`
|
|
175
|
+
query {
|
|
176
|
+
order1s {
|
|
177
|
+
id
|
|
178
|
+
}
|
|
140
179
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
180
|
+
`)
|
|
181
|
+
expect(result).toMatchObject({
|
|
182
|
+
data: null,
|
|
183
|
+
errors: [
|
|
184
|
+
expect.objectContaining({message: 'response might exceed the size limit', path: ['order1s']})
|
|
185
|
+
]
|
|
186
|
+
})
|
|
144
187
|
})
|
|
145
|
-
})
|
|
146
188
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
189
|
+
it('limited requests work', function() {
|
|
190
|
+
return client.test(`
|
|
191
|
+
query {
|
|
192
|
+
order1s(first: 10) {
|
|
193
|
+
items(first: 2) {
|
|
194
|
+
id
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
`, {
|
|
199
|
+
order1s: []
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
it('entity level cardinalities are respected', function() {
|
|
204
|
+
return client.test(`
|
|
205
|
+
query {
|
|
206
|
+
order2s {
|
|
207
|
+
id
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`, {
|
|
211
|
+
order2s: []
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it('item cardinalities are respected', function() {
|
|
216
|
+
return client.test(`
|
|
217
|
+
query {
|
|
218
|
+
order3s(first: 1) {
|
|
219
|
+
items { id }
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
`, {
|
|
223
|
+
order3s: []
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
it('@byteWeight annotations are respected', async function() {
|
|
228
|
+
let result = await client.query(`
|
|
229
|
+
query {
|
|
230
|
+
order3s(first: 1) {
|
|
231
|
+
items(first: 8) { name }
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
`)
|
|
235
|
+
expect(result).toEqual({
|
|
236
|
+
data: null,
|
|
237
|
+
errors: [
|
|
238
|
+
expect.objectContaining({
|
|
239
|
+
message: 'response might exceed the size limit',
|
|
240
|
+
path: ['order3s']
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
await client.test(`
|
|
245
|
+
query {
|
|
246
|
+
order3s(first: 1) {
|
|
247
|
+
items(first: 4) { name }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
`, {
|
|
251
|
+
order3s: []
|
|
252
|
+
})
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
it('id_in conditions are understood', function() {
|
|
256
|
+
return client.test(`
|
|
257
|
+
query {
|
|
258
|
+
order1s(where: {id_in: ["1", "2", "3"]}) {
|
|
259
|
+
id
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
`, {
|
|
263
|
+
order1s: []
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
it('root query fields limit', async function() {
|
|
268
|
+
return client.httpErrorTest(`
|
|
269
|
+
query {
|
|
270
|
+
a: order1(id: "1") { id }
|
|
271
|
+
b: order1(id: "1") { id }
|
|
272
|
+
c: order1(id: "1") { id }
|
|
273
|
+
d: order1(id: "1") { id }
|
|
274
|
+
}
|
|
275
|
+
`, {
|
|
276
|
+
errors: [
|
|
277
|
+
expect.objectContaining({
|
|
278
|
+
message: 'only 3 root fields allowed, but got 4'
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
})
|
|
161
282
|
})
|
|
162
283
|
})
|
|
163
284
|
})
|