Skip to content

Commit

Permalink
chore: fix broken test after merging #73
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Oct 16, 2023
1 parent d07b303 commit bf80011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -31,6 +31,7 @@ const a = /* GraphQL */ `
isOnline
me {
name
foo # added field missing in service schema to ensure it doesn't throw, see https://github.com/apollographql/vscode-graphql/pull/73
localUser @client {
friends {
isLiked
Expand Down
4 changes: 2 additions & 2 deletions 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 || !fieldDef) return;
if (!parentType) return;

// here we collect all of the fields on a type that are marked "local"
const clientFields =
Expand All @@ -194,7 +194,7 @@ export function NoMissingClientDirectives(context: ValidationContext) {
// fields are simple because we can just see if the name exists in the local fields
// array on the parent type
selectsClientFieldSet = Boolean(
clientFields && clientFields.includes(fieldDef!.name)
clientFields && clientFields.includes(fieldDef?.name || "")
);
message += `local field "${node.name.value}"`;
break;
Expand Down

0 comments on commit bf80011

Please sign in to comment.