diff --git a/.changeset/five-spiders-protect.md b/.changeset/five-spiders-protect.md new file mode 100644 index 00000000..0d224591 --- /dev/null +++ b/.changeset/five-spiders-protect.md @@ -0,0 +1,5 @@ +--- +"vscode-apollo": patch +--- + +Return early instead of erroring on missing fields diff --git a/src/language-server/errors/validation.ts b/src/language-server/errors/validation.ts index ab03372c..e5573bca 100644 --- a/src/language-server/errors/validation.ts +++ b/src/language-server/errors/validation.ts @@ -175,7 +175,7 @@ export function NoMissingClientDirectives(context: ValidationContext) { const fieldDef = context.getFieldDef(); // if we don't have a type to check then we can early return - if (!parentType) return; + if (!parentType || !fieldDef) return; // here we collect all of the fields on a type that are marked "local" const clientFields =