-
Hi there, I’m currently working with GraphQL Tada and I’m trying to directly extract types from the introspection_types. I understand that Lets say i have a query that retrieves type User = ResultOf<typeof USER_QUERY>['user'] Or something like that. If I then want to declare a state/variable/Record with the type I also tried to extract it from the introspection_types like this: type User = introspection_types['User']['fields'] Which actually gives me the keys of the User but the types of the corresponding field of lets say
Which i can not tranlate (easily) into typescript types. My question now is why it is not possible to easily extract types from the introspection_types and utilize them as typescript types. If there is a way please let me know. And thank you in advance. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can't retrieve a concrete type for an object type as it depends on a selection set, arguments, etc. See:
You should be creating fragments instead to derive the types of object selections |
Beta Was this translation helpful? Give feedback.
You can't retrieve a concrete type for an object type as it depends on a selection set, arguments, etc.
See:
You should be creating fragments instead to derive the types of object selections