Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit e9652b7

Browse files
committed
Remove Partial from ClientStreamResponse.data type
1 parent ddbfd49 commit e9652b7

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

.changeset/shaggy-apes-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopify/graphql-client": patch
3+
---
4+
5+
Remove `Partial` around the `ClientStreamResponse.data` type

packages/graphql-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const client = createGraphQLClient({
103103

104104
| Name | Type | Description |
105105
| ----------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
106-
| data? | `Partial<TData> \| any` | Currently available data returned from the GraphQL API. If `TData` was provided to the function, the return type is `TData`, else it returns type `any`. |
106+
| data? | `TData \| any` | Currently available data returned from the GraphQL API. If `TData` was provided to the function, the return type is `TData`, else it returns type `any`. |
107107
| errors? | [`ResponseErrors`](#responseerrors) | Errors object that contains any API or network errors that occured while fetching the data from the API. It does not include any `UserErrors`. |
108108
| extensions? | `Record<string, any>` | Additional information on the GraphQL response data and context. It can include the `context` object that contains the context settings used to generate the returned API response. |
109109
| hasNext | `boolean` | Flag to indicate whether the response stream has more incoming data |

packages/graphql-client/src/graphql-client/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export interface ClientResponse<TData = any> extends FetchResponseBody<TData> {
3232
}
3333

3434
export interface ClientStreamResponse<TData = any>
35-
extends Omit<ClientResponse<TData>, "data"> {
36-
data?: Partial<TData>;
35+
extends ClientResponse<TData> {
3736
hasNext: boolean;
3837
}
3938

packages/storefront-api-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const client = createStorefrontApiClient({
124124

125125
| Name | Type | Description |
126126
| ----------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127-
| data? | `Partial<TData> \| any` | Currently available data returned from the Storefront API. If `TData` was provided to the function, the return type is `TData`, else it returns type `any`. |
127+
| data? | `TData \| any` | Currently available data returned from the Storefront API. If `TData` was provided to the function, the return type is `TData`, else it returns type `any`. |
128128
| errors? | [`ResponseErrors`](#responseerrors) | Errors object that contains any API or network errors that occured while fetching the data from the API. It does not include any `UserErrors`. |
129129
| extensions? | `Record<string, any>` | Additional information on the GraphQL response data and context. It can include the `context` object that contains the context settings used to generate the returned API response. |
130130
| hasNext | `boolean` | Flag to indicate whether the response stream has more incoming data |

0 commit comments

Comments
 (0)