Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/framework/solid/reference/functions/useMutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ redirect_from:
function useMutation<TData, TError, TVariables, TOnMutateResult>(options: UseMutationOptions<TData, TError, TVariables, TOnMutateResult>, queryClient?: Accessor<QueryClient>): UseMutationResult<TData, TError, TVariables, TOnMutateResult>;
```

Defined in: [packages/solid-query/src/useMutation.ts:173](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutation.ts#L173)
Defined in: [packages/solid-query/src/useMutation.ts:176](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useMutation.ts#L176)

Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
`useMutation` is the function for that.

## Type Parameters

Expand Down
10 changes: 8 additions & 2 deletions docs/framework/solid/reference/functions/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ redirect_from:
function useQuery<TQueryFnData, TError, TData, TQueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: () => QueryClient): UseQueryResult<TData, TError>;
```

Defined in: [packages/solid-query/src/useQuery.ts:178](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L178)
Defined in: [packages/solid-query/src/useQuery.ts:181](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L181)

Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
The query runs when the options call for it β€” `enabled: false` skips the initial fetch.

### Type Parameters

Expand Down Expand Up @@ -212,7 +215,10 @@ function Posts() {
function useQuery<TQueryFnData, TError, TData, TQueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: () => QueryClient): DefinedUseQueryResult<TData, TError>;
```

Defined in: [packages/solid-query/src/useQuery.ts:226](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L226)
Defined in: [packages/solid-query/src/useQuery.ts:232](https://github.com/TanStack/query/blob/main/packages/solid-query/src/useQuery.ts#L232)

Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
The query runs when the options call for it β€” `enabled: false` skips the initial fetch.

This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.

Expand Down
3 changes: 3 additions & 0 deletions docs/framework/solid/reference/variables/createMutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const createMutation: <TData, TError, TVariables, TOnMutateResult>(options: UseM

Defined in: [packages/solid-query/src/index.ts:80](https://github.com/TanStack/query/blob/main/packages/solid-query/src/index.ts#L80)

Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
`useMutation` is the function for that.

## Type Parameters

### TData
Expand Down
6 changes: 6 additions & 0 deletions docs/framework/solid/reference/variables/createQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Defined in: [packages/solid-query/src/index.ts:57](https://github.com/TanStack/q
<TQueryFnData, TError, TData, TQueryKey>(options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: () => QueryClient): UseQueryResult<TData, TError>;
```

Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
The query runs when the options call for it β€” `enabled: false` skips the initial fetch.

### Type Parameters

#### TQueryFnData
Expand Down Expand Up @@ -217,6 +220,9 @@ function Posts() {
<TQueryFnData, TError, TData, TQueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: () => QueryClient): DefinedUseQueryResult<TData, TError>;
```

Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
The query runs when the options call for it β€” `enabled: false` skips the initial fetch.

This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.

### Type Parameters
Expand Down
3 changes: 3 additions & 0 deletions packages/solid-query/src/useMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import type {
import type { Accessor } from 'solid-js'

/**
* Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
* `useMutation` is the function for that.
*
* @param options - An accessor returning the {@link UseMutationOptions} to use.
* @param queryClient - An accessor for a custom `QueryClient`. Otherwise, the one from the nearest context
* will be used.
Expand Down
6 changes: 6 additions & 0 deletions packages/solid-query/src/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import type {
} from './queryOptions'

/**
* Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
* The query runs when the options call for it β€” `enabled: false` skips the initial fetch.
*
* @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
* @param options - An accessor returning the {@link UndefinedInitialDataOptions} to use β€” everything you can
* pass to `useQuery`.
Expand Down Expand Up @@ -186,6 +189,9 @@ export function useQuery<
): UseQueryResult<TData, TError>

/**
* Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
* The query runs when the options call for it β€” `enabled: false` skips the initial fetch.
*
* This overload is selected when `initialData` is set, so the resulting `data` is never `undefined`.
*
* @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
Expand Down
Loading