Skip to content

Commit

Permalink
Fix for #64: return before error on missing fields (#73)
Browse files Browse the repository at this point in the history
* Use early return when there is no fieldDef

* fix: reverse condition

* chore: add changeset

---------

Co-authored-by: Alessia Bellisario <github@bellisar.io>
  • Loading branch information
rachsmithcodes and alessbell committed Oct 16, 2023
1 parent 78244aa commit d07b303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/five-spiders-protect.md
@@ -0,0 +1,5 @@
---
"vscode-apollo": patch
---

Return early instead of erroring on missing fields
2 changes: 1 addition & 1 deletion src/language-server/errors/validation.ts
Expand Up @@ -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 =
Expand Down

0 comments on commit d07b303

Please sign in to comment.