diff --git a/src/suggestion/getReferenceSuggestions.ts b/src/suggestion/getReferenceSuggestions.ts index f56bc0c..2c3e37d 100644 --- a/src/suggestion/getReferenceSuggestions.ts +++ b/src/suggestion/getReferenceSuggestions.ts @@ -63,8 +63,8 @@ const extractObjectProperties = ( if (properties && properties.length > 0) { properties.forEach(property => { const propType = checker.getTypeOfSymbolAtLocation(property, property.valueDeclaration!); - const propName = property.getName() as ReferencePath; - const newPath = [...currentPath, propName]; + const propName = property.getName(); + const newPath = [...currentPath, {path: propName}]; // Recursively extract nested properties results.push(...extractObjectProperties(propType, checker, expectedType, newPath)); diff --git a/test/getReferenceSuggestions.test.ts b/test/getReferenceSuggestions.test.ts index 4e30b75..b52caa9 100644 --- a/test/getReferenceSuggestions.test.ts +++ b/test/getReferenceSuggestions.test.ts @@ -1,4 +1,4 @@ -import {describe, expect, it} from 'vitest'; +import {describe, it} from 'vitest'; import {getReferenceSuggestions} from '../src/suggestion/getReferenceSuggestions'; import {Flow} from "@code0-tech/sagittarius-graphql-types"; import {DATA_TYPES, FUNCTION_SIGNATURES} from "./data";