File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
test/__tests__/__snapshots__ Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
5959 let response = null ;
6060
6161 try {
62- response = await client . query ( { query : FILE_UPLOAD_INFO_QUERY } ) ;
62+ response = await client . query ( { query : FILE_UPLOAD_INFO_QUERY , fetchPolicy : this . props . fetchPolicy } ) ;
6363 } catch ( e ) {
6464 this . setState ( { error : e } ) ;
6565
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 > ;
Original file line number Diff line number Diff line change 33exports [` should call onChange when file is uploaded for input with custom on upload handler 1` ] = `
44Array [
55 Object {
6+ " fetchPolicy" : undefined ,
67 " query" : Object {
78 " definitions" : Array [
89 Object {
@@ -93,6 +94,7 @@ Array [
9394exports [` should call onChange when file is uploaded for multiple files input 1` ] = `
9495Array [
9596 Object {
97+ " fetchPolicy" : undefined ,
9698 " query" : Object {
9799 " definitions" : Array [
98100 Object {
@@ -183,6 +185,7 @@ Array [
183185exports [` should call onChange when file is uploaded for single file input 1` ] = `
184186Array [
185187 Object {
188+ " fetchPolicy" : undefined ,
186189 " query" : Object {
187190 " definitions" : Array [
188191 Object {
@@ -273,6 +276,7 @@ Array [
273276exports [` should call onChange when file is uploaded for single file input with public modifier 1` ] = `
274277Array [
275278 Object {
279+ " fetchPolicy" : undefined ,
276280 " query" : Object {
277281 " definitions" : Array [
278282 Object {
You can’t perform that action at this time.
0 commit comments