Closed MirrorBytes closed 3 years ago
Related to functioning code:
That's definitely strange. data
is returned exactly from @apollo/client
so I'm not sure how that could happen. I'd need to see the GraphQL and how $forms
is created to diagnose it
If I wrap it with an interface it works, such as:
interface WrappedForm {
get_forms: Form;
}
const form = query<WrappedForm>(client, {
query: GET_FORMS,
variables: {
form: $params.id,
},
});
Now, this could have just been a slip by me since I use TS
This is a weird issue to have, but when I query an array, it believes the returned data is under
data
and notdata.<function_name>
, here's an example:Broken![image](https://user-images.githubusercontent.com/22119469/96539999-7d1fc700-126a-11eb-82be-2e98ee9e62f7.png)
Functioning![image](https://user-images.githubusercontent.com/22119469/96540031-8f9a0080-126a-11eb-8256-82cba6695ff5.png)