Skip to content

Commit 5c6cce6

Browse files
committed
test: add enabled assertion
1 parent 2d98bf2 commit 5c6cce6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/queryObserver.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ export class QueryObserver<
138138

139139
this.options = this.client.defaultQueryObserverOptions(options)
140140

141+
if (
142+
typeof this.options.enabled !== 'undefined' &&
143+
typeof this.options.enabled !== 'boolean'
144+
) {
145+
throw new Error('Expected enabled to be a boolean')
146+
}
147+
141148
// Keep previous query key if the user does not supply one
142149
if (!this.options.queryKey) {
143150
this.options.queryKey = prevOptions.queryKey

0 commit comments

Comments
 (0)