Describe the bug
Please correct me if i'm using useMutation incorrectly but there are no good examples in the documentation
To Reproduce
Just write any mutation with generics
const {
onDone: onSettingsUpdated,
onError: onSettingsUpdateFailed,
mutate: submitSettings,
} = useMutation<{
settings: IProjects.ProjectSettings
}>(UpdateProjectSettingsMutation, { fetchPolicy: 'no-cache' })
onSettingsUpdated(({ data: { settings } }) => {
toast.success(t('settings.notifications.settingsSaved'))
})
and in line
onSettingsUpdated(({ data: { settings } }) => {
compilation failed
src/components/views/ProjectSettingsView.vue:54:30 - error TS2339: Property 'settings' does not exist on type '{ settings: ProjectSettings; } | null | undefined'.
Expected behavior
No compilation errors
Versions
vue: 3.5.17
@vue/apollo-composable: 4.2.2
@vue/apollo-option: 4.2.2
@apollo/client: 3.3.18
Additional context
—
Describe the bug
Please correct me if i'm using useMutation incorrectly but there are no good examples in the documentation
To Reproduce
Just write any mutation with generics
and in line
compilation failed
Expected behavior
No compilation errors
Versions
vue: 3.5.17
@vue/apollo-composable: 4.2.2
@vue/apollo-option: 4.2.2
@apollo/client: 3.3.18
Additional context
—