@strapi/plugin-graphql 4.0.0 → 4.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-graphql",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Adds GraphQL endpoint with default API methods.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,13 +21,16 @@
21
21
  }
22
22
  ],
23
23
  "scripts": {
24
- "test": "echo \"no tests yet\""
24
+ "test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
25
+ "test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
26
+ "test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
27
+ "test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
25
28
  },
26
29
  "dependencies": {
27
30
  "@apollo/federation": "^0.28.0",
28
31
  "@graphql-tools/schema": "8.1.2",
29
32
  "@graphql-tools/utils": "^8.0.2",
30
- "@strapi/utils": "4.0.0",
33
+ "@strapi/utils": "4.0.1",
31
34
  "apollo-server-core": "3.1.2",
32
35
  "apollo-server-koa": "3.1.2",
33
36
  "glob": "^7.1.7",
@@ -37,7 +40,7 @@
37
40
  "graphql-playground-middleware-koa": "^1.6.21",
38
41
  "graphql-type-json": "^0.3.2",
39
42
  "graphql-type-long": "^0.1.1",
40
- "graphql-upload": "12.0.0",
43
+ "graphql-upload": "^13.0.0",
41
44
  "koa-compose": "^4.1.0",
42
45
  "lodash": "4.17.21",
43
46
  "nexus": "1.1.0",
@@ -58,5 +61,5 @@
58
61
  "description": "Adds GraphQL endpoint with default API methods.",
59
62
  "kind": "plugin"
60
63
  },
61
- "gitHead": "b181702f0202b2c6d645d42b195a831f25cd0b03"
64
+ "gitHead": "e2cd01e8c6cbfeba15ad7787e38b6eebcbb92221"
62
65
  }
@@ -24,6 +24,7 @@ const STRAPI_SCALARS = [
24
24
  'integer',
25
25
  'string',
26
26
  'richtext',
27
+ 'enumeration',
27
28
  'biginteger',
28
29
  'float',
29
30
  'decimal',
@@ -46,6 +47,7 @@ const SCALARS_ASSOCIATIONS = {
46
47
  boolean: 'Boolean',
47
48
  integer: 'Int',
48
49
  string: 'String',
50
+ enumeration: 'String',
49
51
  richtext: 'String',
50
52
  biginteger: 'Long',
51
53
  float: 'Float',
@@ -23,11 +23,12 @@ module.exports = ({ strapi }) => {
23
23
  async resolve(parent) {
24
24
  const { args, resourceUID } = parent;
25
25
  const { start, limit } = args;
26
+ const safeLimit = Math.max(limit, 1);
26
27
 
27
28
  const total = await strapi.entityService.count(resourceUID, args);
28
- const pageSize = limit;
29
- const pageCount = limit === 0 ? 0 : Math.ceil(total / limit);
30
- const page = limit === 0 ? 1 : Math.floor(start / limit) + 1;
29
+ const pageSize = limit === -1 ? total - start : safeLimit;
30
+ const pageCount = limit === -1 ? safeLimit : Math.ceil(total / safeLimit);
31
+ const page = limit === -1 ? safeLimit : Math.floor(start / safeLimit) + 1;
31
32
 
32
33
  return { total, page, pageSize, pageCount };
33
34
  },