RequiredMutationResultKey type

The MutationResultKey fields that are always present in the result, because TInput supplies them as required, defined, eligible values.

type RequiredMutationResultKey<T, TInput> = {
  [K in MutationResultKey<T, TInput>]-?: K extends keyof TInput
    ? {} extends Pick<TInput, K>
      ? never
      : undefined extends TInput[K]
      ? never
      : [TInput[K]] extends [EligibleMutationValue<TInput[K]>]
      ? K
      : never
    : never
}[MutationResultKey<T, TInput>]