Skip to content

Commit

Permalink
fix: fix error on missing graphql query properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Oct 25, 2023
1 parent ba89e8b commit 30f903f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helpers/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ export default function initMetrics(app: Express) {
if (query && operationName) {
const definition = parse(query).definitions.find(
// @ts-ignore
def => def.name.value === operationName
def => def.name?.value === operationName
);

if (!definition) {
return;
}

// @ts-ignore
const types = definition.selectionSet.selections.map(sel => sel.name.value);

Expand Down

0 comments on commit 30f903f

Please sign in to comment.