···11+---
22+'@0no-co/graphqlsp': minor
33+---
44+55+Improves field-usage tracking, we bail when the identifier is passed into a function, this bail is intended so we don't have to traverse the whole codebase tracing down usage.
+29
packages/graphqlsp/src/fieldUsage.ts
···283283 if (allFields.find(x => x.startsWith(joined + '.'))) {
284284 pathParts.push(foundRef.text);
285285 }
286286+287287+ // When we encounter an external function where we use this identifier
288288+ // we'll mark all of the sub-fields as used as we consider this a bail
289289+ // scenario.
290290+ if (ts.isCallExpression(foundRef.parent)) {
291291+ const callExpression = foundRef.parent;
292292+ return callExpression.arguments.flatMap(arg => {
293293+ let parts = [...pathParts];
294294+ let reference = arg;
295295+296296+ while (ts.isPropertyAccessExpression(reference)) {
297297+ const joined = [...parts, reference.name.text].join('.');
298298+ if (allFields.find(x => x.startsWith(joined + '.'))) {
299299+ parts.push(reference.name.text);
300300+ }
301301+ reference = reference.expression;
302302+ }
303303+304304+ if (ts.isIdentifier(reference)) {
305305+ const joined = [...parts, reference.getText()].join('.');
306306+ if (allFields.find(x => x.startsWith(joined + '.'))) {
307307+ parts.push(reference.getText());
308308+ }
309309+ }
310310+311311+ const joined = parts.join('.');
312312+ return allFields.filter(x => x.startsWith(joined + '.'));
313313+ });
314314+ }
286315 } else if (
287316 ts.isPropertyAccessExpression(foundRef) &&
288317 foundRef.name.text === 'at' &&