@lenne.tech/ng-base 0.2.0 → 0.2.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.
@@ -1629,14 +1629,23 @@ class GraphQLService {
1629
1629
  /**
1630
1630
  * Get fields / args from IGraphQLTypeCollection
1631
1631
  */
1632
- graphQLTypeCollectionToStringArray(collection, current = '', result = []) {
1632
+ graphQLTypeCollectionToStringArray(collection, current = '', result = [], cacheNode = []) {
1633
1633
  if (collection) {
1634
1634
  if (collection instanceof GraphQLType) {
1635
1635
  result.push(current);
1636
1636
  }
1637
1637
  else {
1638
+ if (current === null || current === void 0 ? void 0 : current.includes('.')) {
1639
+ cacheNode.push(current.split('.')[1]);
1640
+ }
1641
+ else if (current) {
1642
+ cacheNode.push(current);
1643
+ }
1638
1644
  for (const key of Object.keys(collection)) {
1639
- this.graphQLTypeCollectionToStringArray(collection[key], current ? current + '.' + key : key, result);
1645
+ if (current === key || cacheNode.includes(key)) {
1646
+ continue;
1647
+ }
1648
+ this.graphQLTypeCollectionToStringArray(collection[key], current ? current + '.' + key : key, result, cacheNode);
1640
1649
  }
1641
1650
  }
1642
1651
  }
@@ -1688,6 +1697,10 @@ class GraphQLService {
1688
1697
  }
1689
1698
  // Process object
1690
1699
  else if (typeof args === 'object') {
1700
+ // Check object is empty
1701
+ if (args && Object.keys(args).length === 0 && Object.getPrototypeOf(args) === Object.prototype) {
1702
+ return { argsString: '{}', schemaArgs, usedArgs };
1703
+ }
1691
1704
  // Process all object entries
1692
1705
  for (const [key, value] of Object.entries(args)) {
1693
1706
  // Init data for current entry