From c7292ec5b16a972a1ee55d7c3483cb815ccc91a6 Mon Sep 17 00:00:00 2001 From: liaoxuan Date: Mon, 19 Feb 2024 11:13:00 +0800 Subject: [PATCH] docs: correct typo --- README-zh_CN.md | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 079daff..ca561d4 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -611,7 +611,7 @@ const usePost = createQuery({ // `data` 将被推断为 `Data | undefined`. // `variables` 将被推断为 `Variables`. -const { data } = usePost({ variables: 1 }) +const { data } = usePost({ variables: { id: 1 } }) ``` 您还可以显式指定 `fetcher` 参数和返回的类型。 @@ -630,7 +630,7 @@ const usePost = createQuery({ // `data` 将被推断为 `Data | undefined`. // `error` 将被推断为 `Error | null` // `variables` 将被推断为 `Variables`. -const { data, error } = usePost({ variables: 1 }) +const { data, error } = usePost({ variables: { id: 1 } }) ``` ## 类型推导 diff --git a/README.md b/README.md index 1e50ea9..7c84e3f 100644 --- a/README.md +++ b/README.md @@ -611,7 +611,7 @@ const usePost = createQuery({ // `data` will be inferred as `Data | undefined`. // `variables` will be inferred as `Variables`. -const { data } = usePost({ variables: 1 }) +const { data } = usePost({ variables: { id: 1 } }) ``` You can also explicitly specify the types for `fetcher`‘s `variables` and `data`. @@ -630,7 +630,7 @@ const usePost = createQuery({ // `data` will be inferred as `Data | undefined`. // `error` will be inferred as `Error | null` // `variables` will be inferred as `Variables`. -const { data, error } = usePost({ variables: 1 }) +const { data, error } = usePost({ variables: { id: 1 } }) ``` ## Type inference