File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,10 @@ var {
328
328
patch,
329
329
delete // don't destructure `delete` though, it's a keyword
330
330
del, // <- that's why we have this (del). or use `request.delete`
331
+ head,
332
+ options,
333
+ connect,
334
+ trace,
331
335
mutate, // GraphQL
332
336
query, // GraphQL
333
337
abort
Original file line number Diff line number Diff line change @@ -309,6 +309,10 @@ var {
309
309
patch,
310
310
delete // don't destructure `delete` though, it's a keyword
311
311
del, // <- that's why we have this (del). or use `request.delete`
312
+ head,
313
+ options,
314
+ connect,
315
+ trace,
312
316
mutate, // GraphQL
313
317
query, // GraphQL
314
318
abort
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ export enum HTTPMethod {
9
9
PATCH = 'PATCH' ,
10
10
POST = 'POST' ,
11
11
PUT = 'PUT' ,
12
+ CONNECT = 'CONNECT' ,
13
+ TRACE = 'TRACE'
12
14
}
13
15
14
16
// https://www.apollographql.com/docs/react/api/react/hoc/#optionsfetchpolicy
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function useFetch<TData = any>(...args: UseFetchArgs): UseFetch<TData> {
105
105
if ( response . isCached && cachePolicy === CACHE_FIRST ) {
106
106
newRes = response . cached as Response
107
107
} else {
108
- newRes = await fetch ( url , options )
108
+ newRes = ( await fetch ( url , options ) ) . clone ( )
109
109
}
110
110
res . current = newRes . clone ( )
111
111
@@ -208,6 +208,10 @@ function useFetch<TData = any>(...args: UseFetchArgs): UseFetch<TData> {
208
208
post,
209
209
patch : makeFetch ( HTTPMethod . PATCH ) ,
210
210
put : makeFetch ( HTTPMethod . PUT ) ,
211
+ options : makeFetch ( HTTPMethod . OPTIONS ) ,
212
+ head : makeFetch ( HTTPMethod . HEAD ) ,
213
+ connect : makeFetch ( HTTPMethod . CONNECT ) ,
214
+ trace : makeFetch ( HTTPMethod . TRACE ) ,
211
215
del,
212
216
delete : del ,
213
217
abort : ( ) => controller . current && controller . current . abort ( ) ,
You can’t perform that action at this time.
0 commit comments