Created
August 21, 2019 08:16
-
-
Save mizdra/6e4e29e7dac91de7223aa7d46e9d7d54 to your computer and use it in GitHub Desktop.
`is` で絞込むやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Modify<T, K extends keyof T, Value> = Pick<T, Exclude<keyof T, K>> & | |
{ | |
[P in K]: Value | |
} | |
function isError<TData, TVariables>( | |
result: QueryResult<TData, TVariables>, | |
): result is Modify<typeof result, 'error', ApolloError> { | |
return !!result.error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment