@strapi/plugin-graphql 5.0.0-beta.1 → 5.0.0-beta.3

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.
@@ -9,7 +9,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
9
9
  });
10
10
  };
11
11
  const name$1 = "@strapi/plugin-graphql";
12
- const version = "5.0.0-beta.0";
12
+ const version = "5.0.0-beta.2";
13
13
  const description = "Adds GraphQL endpoint with default API methods.";
14
14
  const repository = {
15
15
  type: "git",
@@ -61,10 +61,10 @@ const dependencies = {
61
61
  "@as-integrations/koa": "1.1.1",
62
62
  "@graphql-tools/schema": "8.5.1",
63
63
  "@graphql-tools/utils": "^8.13.1",
64
- "@koa/cors": "3.4.3",
65
- "@strapi/design-system": "1.16.0",
64
+ "@koa/cors": "5.0.0",
65
+ "@strapi/design-system": "1.17.0",
66
66
  "@strapi/icons": "1.16.0",
67
- "@strapi/utils": "5.0.0-beta.0",
67
+ "@strapi/utils": "5.0.0-beta.2",
68
68
  graphql: "^16.8.1",
69
69
  "graphql-depth-limit": "^1.1.0",
70
70
  "graphql-playground-middleware-koa": "^1.6.21",
@@ -76,19 +76,19 @@ const dependencies = {
76
76
  pluralize: "8.0.0"
77
77
  };
78
78
  const devDependencies = {
79
- "@strapi/strapi": "5.0.0-beta.0",
80
- "@strapi/types": "5.0.0-beta.0",
79
+ "@strapi/strapi": "5.0.0-beta.2",
80
+ "@strapi/types": "5.0.0-beta.2",
81
81
  "@types/graphql-depth-limit": "1.1.5",
82
82
  "@types/koa-bodyparser": "4.3.12",
83
83
  "@types/koa__cors": "5.0.0",
84
84
  "cross-env": "^7.0.3",
85
- "eslint-config-custom": "5.0.0-beta.0",
86
- koa: "2.13.4",
85
+ "eslint-config-custom": "5.0.0-beta.2",
86
+ koa: "2.15.2",
87
87
  react: "^18.2.0",
88
88
  "react-dom": "^18.2.0",
89
89
  "react-router-dom": "6.22.3",
90
90
  "styled-components": "5.3.11",
91
- tsconfig: "5.0.0-beta.0",
91
+ tsconfig: "5.0.0-beta.2",
92
92
  typescript: "5.3.2"
93
93
  };
94
94
  const peerDependencies = {
@@ -8,7 +8,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
8
8
  });
9
9
  };
10
10
  const name$1 = "@strapi/plugin-graphql";
11
- const version = "5.0.0-beta.0";
11
+ const version = "5.0.0-beta.2";
12
12
  const description = "Adds GraphQL endpoint with default API methods.";
13
13
  const repository = {
14
14
  type: "git",
@@ -60,10 +60,10 @@ const dependencies = {
60
60
  "@as-integrations/koa": "1.1.1",
61
61
  "@graphql-tools/schema": "8.5.1",
62
62
  "@graphql-tools/utils": "^8.13.1",
63
- "@koa/cors": "3.4.3",
64
- "@strapi/design-system": "1.16.0",
63
+ "@koa/cors": "5.0.0",
64
+ "@strapi/design-system": "1.17.0",
65
65
  "@strapi/icons": "1.16.0",
66
- "@strapi/utils": "5.0.0-beta.0",
66
+ "@strapi/utils": "5.0.0-beta.2",
67
67
  graphql: "^16.8.1",
68
68
  "graphql-depth-limit": "^1.1.0",
69
69
  "graphql-playground-middleware-koa": "^1.6.21",
@@ -75,19 +75,19 @@ const dependencies = {
75
75
  pluralize: "8.0.0"
76
76
  };
77
77
  const devDependencies = {
78
- "@strapi/strapi": "5.0.0-beta.0",
79
- "@strapi/types": "5.0.0-beta.0",
78
+ "@strapi/strapi": "5.0.0-beta.2",
79
+ "@strapi/types": "5.0.0-beta.2",
80
80
  "@types/graphql-depth-limit": "1.1.5",
81
81
  "@types/koa-bodyparser": "4.3.12",
82
82
  "@types/koa__cors": "5.0.0",
83
83
  "cross-env": "^7.0.3",
84
- "eslint-config-custom": "5.0.0-beta.0",
85
- koa: "2.13.4",
84
+ "eslint-config-custom": "5.0.0-beta.2",
85
+ koa: "2.15.2",
86
86
  react: "^18.2.0",
87
87
  "react-dom": "^18.2.0",
88
88
  "react-router-dom": "6.22.3",
89
89
  "styled-components": "5.3.11",
90
- tsconfig: "5.0.0-beta.0",
90
+ tsconfig: "5.0.0-beta.2",
91
91
  typescript: "5.3.2"
92
92
  };
93
93
  const peerDependencies = {
@@ -159,9 +159,6 @@ async function bootstrap({ strapi: strapi2 }) {
159
159
  type: "content-api"
160
160
  }
161
161
  };
162
- if (ctx.request.method === "GET") {
163
- return next();
164
- }
165
162
  return strapi2.auth.authenticate(ctx, next);
166
163
  });
167
164
  handler.push(
@@ -2047,11 +2044,11 @@ const createCollectionTypeMutationsBuilder = ({ strapi: strapi2 }) => {
2047
2044
  },
2048
2045
  async resolve(parent, args22, context) {
2049
2046
  const { auth } = context.state;
2050
- const { data, documentId, ...restParams } = args22;
2047
+ const { data, ...restParams } = args22;
2051
2048
  const sanitizedInputData = await strapi2.contentAPI.sanitize.input(data, contentType2, {
2052
2049
  auth
2053
2050
  });
2054
- return strapi2.documents(uid).update(documentId, {
2051
+ return strapi2.documents(uid).update({
2055
2052
  ...restParams,
2056
2053
  data: sanitizedInputData
2057
2054
  });
@@ -2074,7 +2071,7 @@ const createCollectionTypeMutationsBuilder = ({ strapi: strapi2 }) => {
2074
2071
  },
2075
2072
  async resolve(parent, args22) {
2076
2073
  const { documentId } = args22;
2077
- await strapi2.documents(uid).delete(documentId);
2074
+ await strapi2.documents(uid).delete({ documentId });
2078
2075
  return { documentId };
2079
2076
  }
2080
2077
  });
@@ -2154,8 +2151,9 @@ const createSingleTypeMutationsBuilder = ({ strapi: strapi2 }) => {
2154
2151
  });
2155
2152
  const document = await strapi2.db?.query(uid).findOne();
2156
2153
  if (document) {
2157
- return strapi2.documents(uid).update(document.documentId, {
2154
+ return strapi2.documents(uid).update({
2158
2155
  ...args22,
2156
+ documentId: document.documentId,
2159
2157
  data: sanitizedInputData
2160
2158
  });
2161
2159
  }
@@ -2183,7 +2181,7 @@ const createSingleTypeMutationsBuilder = ({ strapi: strapi2 }) => {
2183
2181
  if (!document) {
2184
2182
  throw new NotFoundError("Document not found");
2185
2183
  }
2186
- await strapi2.documents(uid).delete(document.documentId, args22);
2184
+ await strapi2.documents(uid).delete({ ...args22, documentId: document.documentId });
2187
2185
  return document;
2188
2186
  }
2189
2187
  });
@@ -2482,15 +2480,17 @@ const queriesResolvers = ({ strapi: strapi2 }) => ({
2482
2480
  return strapi2.documents(uid).findFirst({ status: "published", ...sanitizedQuery });
2483
2481
  },
2484
2482
  async findOne(parent, args2, ctx) {
2483
+ const { documentId } = args2;
2485
2484
  await strapi2.contentAPI.validate.query(args2, contentType2, {
2486
2485
  auth: ctx?.state?.auth
2487
2486
  });
2488
2487
  const sanitizedQuery = await strapi2.contentAPI.sanitize.query(args2, contentType2, {
2489
2488
  auth: ctx?.state?.auth
2490
2489
  });
2491
- return strapi2.documents(uid).findOne(args2.documentId, {
2490
+ return strapi2.documents(uid).findOne({
2492
2491
  status: "published",
2493
- ...fp.omit(["id", "documentId"], sanitizedQuery)
2492
+ ...fp.omit(["id", "documentId"], sanitizedQuery),
2493
+ documentId
2494
2494
  });
2495
2495
  }
2496
2496
  };