Replies: 1 comment 2 replies
-
It's not possible for us to detect when certain sub-parts of the types are used when any indirection occurs. Even if we made the detection more complex, there'll always be parts of this that we can't track since we don't have access to a type dependency graph, so to speak, and can't scan every part of the document. Doing this would lead to a lot of derivative types that are hard to detect as usage patterns for fields. As such, it often makes sense to turn the field usage feature off in these cases |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue 1: Unused Fields Detection
When using ts-pattern for type matching, TypeScript doesn't detect that certain fields, such as users.name, are used. This leads to false warnings like:
Issue 2: Type Narrowing with
__typename
fieldTypeScript fails to narrow the type when using ts-pattern to match on the __typename field. For example, the following code throws a type error:
Beta Was this translation helpful? Give feedback.
All reactions