Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseAsyncQuery fails to get correct type on res data #632

Open
wrzrmzx opened this issue Aug 7, 2024 · 1 comment
Open

UseAsyncQuery fails to get correct type on res data #632

wrzrmzx opened this issue Aug 7, 2024 · 1 comment
Labels

Comments

@wrzrmzx
Copy link

wrzrmzx commented Aug 7, 2024

Environment

Describe the bug

After I update the deps using pnpm up -Lir, I got wrong type in data:
const { data } = await useAsyncQuery<Query>()
vscode shows: const data: AsyncData<T, Error> rather than ListNotificationGqlResult(a type in Query)
so that I got wrong in const listNoteCountTypesCommentReply = computed(() =>listUnreadNotificationsCount.value.list.find(item => item.msgtype === 'comment_reply')?.count || 0)
for item gets any type

Expected behaviour

type of data mentioned above is ListNotificationGqlResult

Reproduction

https://github.com/PatchyVideo/platinum/blob/nuxt/pages/notification.vue#L32 type of data cannot be infered as ListNotificationGqlResult
while history version
https://github.com/PatchyVideo/platinum/blob/a29204bc08f402dff7f625802a8b51a3e651b34d/pages/notification.vue#L32 can infer it correctly

Additional context

plugin GraphQL v0.1.2 and Apollo GraphQL v1.20.0 is installed in my vscode

Logs

No response

@wrzrmzx wrzrmzx added the bug label Aug 7, 2024
@wrzrmzx
Copy link
Author

wrzrmzx commented Nov 21, 2024

It's strange that I found useQuery works well
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant