@strapi/plugin-graphql 4.15.1 → 4.15.3-alpha.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/.eslintignore +1 -2
- package/.eslintrc +14 -0
- package/package.json +27 -7
- package/packup.config.ts +42 -0
- package/server/services/builders/resolvers/component.js +2 -2
- package/.eslintrc.js +0 -14
- package/strapi-admin.js +0 -3
package/.eslintignore
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
.eslintrc.js
|
|
1
|
+
dist
|
package/.eslintrc
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-graphql",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.3-alpha.0",
|
|
4
4
|
"description": "Adds GraphQL endpoint with default API methods.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,16 +20,34 @@
|
|
|
20
20
|
"url": "https://strapi.io"
|
|
21
21
|
}
|
|
22
22
|
],
|
|
23
|
+
"exports": {
|
|
24
|
+
"./strapi-admin": {
|
|
25
|
+
"source": "./admin/src/index.js",
|
|
26
|
+
"import": "./dist/admin/index.mjs",
|
|
27
|
+
"require": "./dist/admin/index.js",
|
|
28
|
+
"default": "./dist/admin/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./strapi-server": {
|
|
31
|
+
"source": "./strapi-server.js",
|
|
32
|
+
"require": "./strapi-server.js",
|
|
33
|
+
"default": "./strapi-server.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
23
37
|
"scripts": {
|
|
24
|
-
"
|
|
38
|
+
"build": "pack-up build",
|
|
39
|
+
"clean": "run -T rimraf dist",
|
|
40
|
+
"lint": "run -T eslint .",
|
|
41
|
+
"prepublishOnly": "yarn clean && yarn build",
|
|
42
|
+
"watch": "pack-up watch"
|
|
25
43
|
},
|
|
26
44
|
"dependencies": {
|
|
27
45
|
"@graphql-tools/schema": "8.5.1",
|
|
28
46
|
"@graphql-tools/utils": "^8.13.1",
|
|
29
47
|
"@strapi/design-system": "1.13.0",
|
|
30
|
-
"@strapi/helper-plugin": "4.15.
|
|
48
|
+
"@strapi/helper-plugin": "4.15.3-alpha.0",
|
|
31
49
|
"@strapi/icons": "1.13.0",
|
|
32
|
-
"@strapi/utils": "4.15.
|
|
50
|
+
"@strapi/utils": "4.15.3-alpha.0",
|
|
33
51
|
"apollo-server-core": "3.12.1",
|
|
34
52
|
"apollo-server-koa": "3.10.0",
|
|
35
53
|
"graphql": "^15.5.1",
|
|
@@ -43,6 +61,8 @@
|
|
|
43
61
|
"pluralize": "8.0.0"
|
|
44
62
|
},
|
|
45
63
|
"devDependencies": {
|
|
64
|
+
"@strapi/pack-up": "4.15.3-alpha.0",
|
|
65
|
+
"@strapi/strapi": "4.15.3-alpha.0",
|
|
46
66
|
"cross-env": "^7.0.3",
|
|
47
67
|
"koa": "2.13.4",
|
|
48
68
|
"react": "^18.2.0",
|
|
@@ -54,8 +74,8 @@
|
|
|
54
74
|
"@strapi/strapi": "^4.0.0",
|
|
55
75
|
"react": "^17.0.0 || ^18.0.0",
|
|
56
76
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
57
|
-
"react-router-dom": "5.
|
|
58
|
-
"styled-components": "5.
|
|
77
|
+
"react-router-dom": "^5.2.0",
|
|
78
|
+
"styled-components": "^5.2.1"
|
|
59
79
|
},
|
|
60
80
|
"engines": {
|
|
61
81
|
"node": ">=18.0.0 <=20.x.x",
|
|
@@ -67,5 +87,5 @@
|
|
|
67
87
|
"description": "Adds GraphQL endpoint with default API methods.",
|
|
68
88
|
"kind": "plugin"
|
|
69
89
|
},
|
|
70
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "81425b4b9803fd4df570e050c40dd984ebd28ac6"
|
|
71
91
|
}
|
package/packup.config.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Config, defineConfig } from '@strapi/pack-up';
|
|
2
|
+
import { transformWithEsbuild } from 'vite';
|
|
3
|
+
|
|
4
|
+
const config: Config = defineConfig({
|
|
5
|
+
bundles: [
|
|
6
|
+
{
|
|
7
|
+
source: './admin/src/index.js',
|
|
8
|
+
import: './dist/admin/index.mjs',
|
|
9
|
+
require: './dist/admin/index.js',
|
|
10
|
+
runtime: 'web',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
dist: './dist',
|
|
14
|
+
/**
|
|
15
|
+
* Because we're exporting a server & client package
|
|
16
|
+
* which have different runtimes we want to ignore
|
|
17
|
+
* what they look like in the package.json
|
|
18
|
+
*/
|
|
19
|
+
exports: {},
|
|
20
|
+
plugins: [
|
|
21
|
+
{
|
|
22
|
+
name: 'treat-js-files-as-jsx',
|
|
23
|
+
async transform(code, id) {
|
|
24
|
+
/**
|
|
25
|
+
* Matches all files in src/ and ee/ that end with .js
|
|
26
|
+
*/
|
|
27
|
+
if (!id.match(/src\/.*\.js$/) && !id.match(/ee\/.*\.js$/)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Use the exposed transform from vite, instead of directly
|
|
32
|
+
// transforming with esbuild
|
|
33
|
+
return transformWithEsbuild(code, id, {
|
|
34
|
+
loader: 'tsx',
|
|
35
|
+
jsx: 'automatic',
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default config;
|
|
@@ -13,10 +13,10 @@ module.exports = ({ strapi }) => ({
|
|
|
13
13
|
const component = strapi.getModel(componentName);
|
|
14
14
|
|
|
15
15
|
const transformedArgs = transformArgs(args, { contentType: component, usePagination: true });
|
|
16
|
-
await validate.contentAPI.query(transformedArgs,
|
|
16
|
+
await validate.contentAPI.query(transformedArgs, component, {
|
|
17
17
|
auth: ctx?.state?.auth,
|
|
18
18
|
});
|
|
19
|
-
const sanitizedQuery = await sanitize.contentAPI.query(transformedArgs,
|
|
19
|
+
const sanitizedQuery = await sanitize.contentAPI.query(transformedArgs, component, {
|
|
20
20
|
auth: ctx?.state?.auth,
|
|
21
21
|
});
|
|
22
22
|
return strapi.entityService.load(contentTypeUID, parent, attributeName, sanitizedQuery);
|
package/.eslintrc.js
DELETED
package/strapi-admin.js
DELETED