File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
2323 maxFiles : 1 ,
2424 value : null ,
2525 sessionCache : false ,
26+ fetchPolicy : 'network-only' ,
2627 } ;
2728
2829 public static getDerivedStateFromProps ( props : FileInputProps , state : FileInputState ) {
@@ -59,7 +60,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
5960 let response = null ;
6061
6162 try {
62- response = await client . query ( { query : FILE_UPLOAD_INFO_QUERY , fetchPolicy : 'network-only' } ) ;
63+ response = await client . query ( { query : FILE_UPLOAD_INFO_QUERY , fetchPolicy : this . props . fetchPolicy } ) ;
6364 } catch ( e ) {
6465 this . setState ( { error : e } ) ;
6566
Original file line number Diff line number Diff line change 1+ import { FetchPolicy } from 'apollo-client' ;
2+
13export type FileValue = {
24 fileId : string ;
35 filename : string ;
@@ -19,6 +21,7 @@ export type FileInputProps = {
1921 error : object | null ;
2022 } ) => React . ReactNode ;
2123 public ?: boolean ;
24+ fetchPolicy ?: FetchPolicy ;
2225 maxFiles ?: number ;
2326 sessionCache ?: boolean ;
2427 onUploadDone ?: ( value : FileInputValue , originalFile ?: OriginalFileInputValue ) => Promise < FileInputValue > ;
You can’t perform that action at this time.
0 commit comments