You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parseResolveInfo return type is ResolveTree | FieldsByTypeName | null | undefined. You can get rid of null | undefined with an if condition but you're left with ResolveTree | FieldsByTypeName. The problem is that simplifyParsedResolveInfoFragmentWithType expects a ResolveTree as its first argument. We need a way to tell them apart. Right now I'm using this:
functionisResolveTree(value: ResolveTree|FieldsByTypeName,): value is ResolveTree{returntypeofvalue.name==="string"&&Boolean(value.fieldsByTypeName);}
Motivating example
It's hard to use simplifyParsedResolveInfoFragmentWithType when using TypeScript without this type guard, unless I'm doing something wrong here.
Supporting development
I [tick all that apply]:
am interested in building this feature myself
am interested in collaborating on building this feature
am willing to help testing this feature before it's released
am willing to write a test-driven test suite for this feature (before it exists)
Feature description
parseResolveInfo
return type isResolveTree | FieldsByTypeName | null | undefined
. You can get rid ofnull | undefined
with anif
condition but you're left withResolveTree | FieldsByTypeName
. The problem is thatsimplifyParsedResolveInfoFragmentWithType
expects aResolveTree
as its first argument. We need a way to tell them apart. Right now I'm using this:Motivating example
It's hard to use
simplifyParsedResolveInfoFragmentWithType
when using TypeScript without this type guard, unless I'm doing something wrong here.Supporting development
I [tick all that apply]:
The text was updated successfully, but these errors were encountered: