@strapi/plugin-graphql 4.1.2 → 4.1.4-alpha.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.1.2",
3
+ "version": "4.1.4-alpha.1",
4
4
  "description": "Adds GraphQL endpoint with default API methods.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "@apollo/federation": "^0.28.0",
31
31
  "@graphql-tools/schema": "8.1.2",
32
32
  "@graphql-tools/utils": "^8.0.2",
33
- "@strapi/utils": "4.1.2",
33
+ "@strapi/utils": "4.1.4-alpha.1",
34
34
  "apollo-server-core": "3.1.2",
35
35
  "apollo-server-koa": "3.1.2",
36
36
  "glob": "^7.1.7",
@@ -64,5 +64,5 @@
64
64
  "description": "Adds GraphQL endpoint with default API methods.",
65
65
  "kind": "plugin"
66
66
  },
67
- "gitHead": "6f72c3805232bc6c4b229aecfb19909b9f68d98d"
67
+ "gitHead": "28155df2bef16f415127fd6e65bd5f223f816d47"
68
68
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { enumType } = require('nexus');
4
4
  const { set } = require('lodash/fp');
5
+ const { toRegressedEnumValue } = require('@strapi/utils');
5
6
 
6
7
  /**
7
8
  * Build a Nexus enum type from a Strapi enum attribute
@@ -13,9 +14,10 @@ const { set } = require('lodash/fp');
13
14
  const buildEnumTypeDefinition = (definition, name) => {
14
15
  return enumType({
15
16
  name,
16
- // In Strapi V3, the key of an enum is also its value
17
- // todo[V4]: allow passing an object of key/value instead of an array
18
- members: definition.enum.reduce((acc, value) => set(value, value, acc), {}),
17
+ members: definition.enum.reduce(
18
+ (acc, value) => set(toRegressedEnumValue(value), value, acc),
19
+ {}
20
+ ),
19
21
  });
20
22
  };
21
23