Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed Oct 21, 2021
1 parent 326c0d7 commit 475c409
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/graphql-docs-generator/src/generator/getFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ export default function getFields(
}

function adjustDepth(field, depth) {
if (isGraphQLAggregateField(field)) {
return depth + 1;
}
return depth - 1;
}

function isGraphQLAggregateField(field) {
if (
field &&
field.name == 'aggregateItems' &&
field.type?.ofType?.name == 'SearchableAggregateResult'
) {
return depth + 1;
return true;
}
return depth - 1;
}
return false;
}

0 comments on commit 475c409

Please sign in to comment.