Feature description
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:
function isResolveTree(
value: ResolveTree | FieldsByTypeName,
): value is ResolveTree {
return typeof value.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]:
Feature description
parseResolveInforeturn type isResolveTree | FieldsByTypeName | null | undefined. You can get rid ofnull | undefinedwith anifcondition but you're left withResolveTree | FieldsByTypeName. The problem is thatsimplifyParsedResolveInfoFragmentWithTypeexpects aResolveTreeas its first argument. We need a way to tell them apart. Right now I'm using this:Motivating example
It's hard to use
simplifyParsedResolveInfoFragmentWithTypewhen using TypeScript without this type guard, unless I'm doing something wrong here.Supporting development
I [tick all that apply]: