@platformatic/sql-graphql 0.28.1 → 0.30.0
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/package.json +3 -3
- package/test/relations.test.js +3 -6
- package/test/sqlite.test.js +2 -4
- package/test/where.test.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/sql-graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Map SQL dbs to GraphQL",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"tap": "^16.3.6",
|
|
23
23
|
"tsd": "^0.28.1",
|
|
24
24
|
"ws": "^8.13.0",
|
|
25
|
-
"@platformatic/sql-events": "0.
|
|
26
|
-
"@platformatic/sql-mapper": "0.
|
|
25
|
+
"@platformatic/sql-events": "0.30.0",
|
|
26
|
+
"@platformatic/sql-mapper": "0.30.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@mercuriusjs/federation": "^2.0.0",
|
package/test/relations.test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { test } = require('tap')
|
|
4
4
|
const { tmpdir } = require('os')
|
|
5
5
|
const { randomUUID } = require('crypto')
|
|
6
6
|
const { join } = require('path')
|
|
@@ -9,10 +9,7 @@ const sqlMapper = require('@platformatic/sql-mapper')
|
|
|
9
9
|
const fastify = require('fastify')
|
|
10
10
|
const { isSQLite, connInfo, isMysql, clear } = require('./helper')
|
|
11
11
|
|
|
12
|
-
test('should fail when an unknown foreign key relationship exists', async ({ pass, rejects, same, teardown }) => {
|
|
13
|
-
if (!isSQLite) {
|
|
14
|
-
skip('The db is not SQLite')
|
|
15
|
-
}
|
|
12
|
+
test('should fail when an unknown foreign key relationship exists', { skip: !isSQLite }, async ({ pass, rejects, same, teardown }) => {
|
|
16
13
|
const file = join(tmpdir(), randomUUID())
|
|
17
14
|
const app = fastify()
|
|
18
15
|
app.register(sqlMapper, {
|
|
@@ -54,7 +51,7 @@ test('should fail when an unknown foreign key relationship exists', async ({ pas
|
|
|
54
51
|
}
|
|
55
52
|
`
|
|
56
53
|
}
|
|
57
|
-
}),
|
|
54
|
+
}), 'No foreign table named "subcategories" was found')
|
|
58
55
|
})
|
|
59
56
|
|
|
60
57
|
test('should handle multi references', async ({ pass, teardown, same, equal }) => {
|
package/test/sqlite.test.js
CHANGED
|
@@ -103,8 +103,7 @@ test('demo', async ({ pass, same, equal, teardown }) => {
|
|
|
103
103
|
CREATE TABLE categories (
|
|
104
104
|
id INTEGER PRIMARY KEY,
|
|
105
105
|
name TEXT NOT NULL
|
|
106
|
-
)
|
|
107
|
-
);`)
|
|
106
|
+
);`)
|
|
108
107
|
|
|
109
108
|
await db.query(sql`
|
|
110
109
|
CREATE TABLE pages (
|
|
@@ -113,8 +112,7 @@ test('demo', async ({ pass, same, equal, teardown }) => {
|
|
|
113
112
|
body TEXT,
|
|
114
113
|
category_id INTEGER,
|
|
115
114
|
FOREIGN KEY (category_id) REFERENCES categories(id) ON DELETE CASCADE
|
|
116
|
-
)
|
|
117
|
-
);`)
|
|
115
|
+
);`)
|
|
118
116
|
}
|
|
119
117
|
})
|
|
120
118
|
app.register(sqlGraphQL)
|
package/test/where.test.js
CHANGED
|
@@ -1040,7 +1040,7 @@ test('like', async ({ pass, teardown, same, equal }) => {
|
|
|
1040
1040
|
}, 'where: { longText: { like: "%o%" } } response')
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
-
{
|
|
1043
|
+
if (!isSQLite) {
|
|
1044
1044
|
const res = await app.inject({
|
|
1045
1045
|
method: 'POST',
|
|
1046
1046
|
url: '/graphql',
|
|
@@ -1070,7 +1070,7 @@ test('like', async ({ pass, teardown, same, equal }) => {
|
|
|
1070
1070
|
}, 'where: { counter: { like: 10 } } response')
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
-
{
|
|
1073
|
+
if (!isSQLite) {
|
|
1074
1074
|
const res = await app.inject({
|
|
1075
1075
|
method: 'POST',
|
|
1076
1076
|
url: '/graphql',
|