@graphql-markdown/printer-legacy 1.2.1 → 1.2.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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "bugs": {
6
6
  "url": "https://github.com/graphql-markdown/graphql-markdown/issues"
7
7
  },
8
- "version": "1.2.1",
8
+ "version": "1.2.3",
9
9
  "license": "MIT",
10
10
  "main": "src/index.js",
11
11
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "stryker": "stryker run"
23
23
  },
24
24
  "dependencies": {
25
- "@graphql-markdown/utils": "^1.2.0"
25
+ "@graphql-markdown/utils": "^1.3.0"
26
26
  },
27
27
  "directories": {
28
28
  "test": "tests"
package/src/group.js CHANGED
@@ -4,13 +4,16 @@ const {
4
4
  graphql: { getNamedType },
5
5
  } = require("@graphql-markdown/utils");
6
6
 
7
- const getGroup = (type, groups) => {
7
+ const getGroup = (type, groups, typeCategory) => {
8
8
  if (typeof groups !== "object" || groups === null) {
9
9
  return "";
10
10
  }
11
11
  const graphLQLNamedType = getNamedType(type);
12
12
  const typeName = graphLQLNamedType.name || graphLQLNamedType;
13
- return hasProperty(groups, typeName) ? toSlug(groups[typeName]) : "";
13
+ return hasProperty(groups, typeCategory) &&
14
+ hasProperty(groups[typeCategory], typeName)
15
+ ? toSlug(groups[typeCategory][typeName])
16
+ : "";
14
17
  };
15
18
 
16
19
  module.exports = {
package/src/link.js CHANGED
@@ -92,7 +92,7 @@ class Link {
92
92
  ? DEPRECATED
93
93
  : "";
94
94
  const group = hasProperty(options, "groups")
95
- ? getGroup(type, options.groups)
95
+ ? getGroup(type, options.groups, category.plural)
96
96
  : "";
97
97
  const url = pathUrl.join(
98
98
  options.basePath,