@jsb188/graphql 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cache/config.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  export const QUERY_EXPIRE_TIMES = {
8
- __default: 3.6e+6, // 1 hour
8
+ __default: 5.4e+6, // 1.5 hours
9
9
  // 6.48e+7, // 18 hours
10
10
  } as {
11
11
  [key: string]: number;
package/cache/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { makeVariablesKey } from '@jsb188/app/utils/logic';
2
- import { cloneArrayLike, mapArrayLikeObjects } from '@jsb188/app/utils/object';
2
+ import { cloneArrayLike, mapArrayLikeObjects, uniq } from '@jsb188/app/utils/object';
3
3
  import type { UpdateObserversFn } from '../types.d';
4
4
  import { PARTIALS_MAP, RULES } from './config';
5
5
 
@@ -40,7 +40,7 @@ function enforceArrayType(obj: any): any {
40
40
  * Merge nested objects together
41
41
  */
42
42
 
43
- export function mergeNestedObjects(obj1: any, obj2: any) {
43
+ function mergeNestedObjects(obj1: any, obj2: any) {
44
44
  if (!obj1) {
45
45
  return { ...obj2 };
46
46
  }
@@ -63,7 +63,7 @@ export function mergeNestedObjects(obj1: any, obj2: any) {
63
63
  * Make Object for fragment, omitting what you don't need
64
64
  */
65
65
 
66
- function extractFragment(dataObj: any, innerSelection: any[]) {
66
+ function extractFragment(dataObj: any, innerSelection: any[], isTest?: boolean) {
67
67
  if (innerSelection.length <= 1) {
68
68
  return dataObj;
69
69
  }
@@ -144,7 +144,7 @@ export function loadFragment(id: string) {
144
144
  return fragment;
145
145
  }
146
146
 
147
- // const isTest = id.startsWith('$logEntryFragment:9479647167133727') && false;
147
+ // const isTest = id.startsWith('$reportFragment:3789505824043091-4255281447699102-3789105884863193');
148
148
  // if (isTest) {
149
149
  // ..
150
150
  // }
@@ -155,8 +155,12 @@ export function loadFragment(id: string) {
155
155
  if (Object.prototype.hasOwnProperty.call(spreads, key)) {
156
156
  const spreadValue = spreads[key];
157
157
 
158
+ // if (isInnerTest) {
159
+ // console.log('SPREAD:', key, '->', spreadValue, typeof spreadValue);
160
+ // }
161
+
158
162
  // if (isTest) {
159
- // console.log('SPREAD:', key, '->', spreadValue);
163
+ // console.log('SPREAD:', key, '->', spreadValue, typeof spreadValue);
160
164
  // }
161
165
 
162
166
  let spreadData;
@@ -164,10 +168,16 @@ export function loadFragment(id: string) {
164
168
  spreadData = enforceArrayType(FRAGMENTS.get(spreadValue));
165
169
  } else if (Array.isArray(spreadValue)) {
166
170
  spreadData = spreadValue.reduce((acc, value) => {
171
+
172
+ // if (isTest) {
173
+ // console.log('????', value);
174
+ // }
175
+
176
+
167
177
  if (typeof value === 'string') {
168
178
  const fragmentData = enforceArrayType(FRAGMENTS.get(value));
169
179
 
170
- // if (isTest && key === 'details') {
180
+ // if (isTest) {
171
181
  // console.log('1:', value, fragmentData);
172
182
  // }
173
183
 
@@ -177,8 +187,6 @@ export function loadFragment(id: string) {
177
187
  };
178
188
  } else if (Array.isArray(value)) {
179
189
  const [namespace, innerValue] = value;
180
- // console.log('2:', namespace, value);
181
-
182
190
  return {
183
191
  ...acc,
184
192
  [namespace]: innerValue,
@@ -190,13 +198,29 @@ export function loadFragment(id: string) {
190
198
  } else if (spreadValue?.__list === true) {
191
199
  spreadData = spreadValue.data.map((val: any) => {
192
200
 
201
+ // if (isTest) {
202
+ // console.log('>>> VAL:', val);
203
+ // }
204
+
193
205
  // NOTE: I haven't fully finished this work,
194
206
  // but it should work for most cases.
195
207
 
196
208
  if (typeof val === 'string') {
197
209
  return loadFragment(val);
198
210
  } else if (Array.isArray(val) && typeof val[0] === 'string' && val[0].startsWith('$')) {
199
- return loadFragment(val[0]);
211
+ const [innerFragmentKey, ...restInner] = val;
212
+ const innerFragment = loadFragment(innerFragmentKey);
213
+
214
+ if (innerFragment) {
215
+ for (const ri of restInner) {
216
+ if (Array.isArray(ri) && ri.length === 2) {
217
+ // ri[0] === 'files' && ri[1].length === 1 && console.log(ri);
218
+ // innerFragment[ri[0]] = ri[1];
219
+ }
220
+ }
221
+ }
222
+
223
+ return innerFragment;
200
224
  }
201
225
 
202
226
  // Unfinished work
@@ -227,6 +251,7 @@ function mapSelections(data: any, innerSelections: any[], updatedKeys: string[]
227
251
  // These are fragment spreads
228
252
  const frgName = inner.name.value;
229
253
  const frgMap = PARTIALS_MAP[frgName];
254
+
230
255
  fragmentKey = `$${frgMap || frgName}:${data.id || 'none'}`;
231
256
 
232
257
  } else if (inner.kind === 'Field' && inner.selectionSet && inner.selectionSet.selections?.length) {
@@ -263,13 +288,19 @@ function mapSelections(data: any, innerSelections: any[], updatedKeys: string[]
263
288
  // Because partials might have data that's not in the main fragment
264
289
  const currentData = loadFragment(fragmentKey);
265
290
 
266
- // if (fragmentKey.startsWith('$accountFragment:')) {
267
- // console.log('>>>>', fragmentKey);
291
+ // console.log(fragmentKey);
292
+ // if (fragmentKey.startsWith('$reportFragment:3789505824043091-4255281447699102-3789105884863193')) {
293
+ // console.log('>>>>');
294
+ // console.log('>>>>');
295
+ // console.log('>>>>');
296
+ // console.log('>>>>');
297
+ // console.log(currentData);
268
298
  // console.log(data);
269
299
  // console.log(extractFragment(data, innerSelections));
270
300
  // }
271
301
 
272
- FRAGMENTS.set(fragmentKey, mergeNestedObjects(currentData, extractFragment(data, innerSelections)));
302
+ const fragmentFromData = extractFragment(data, innerSelections);
303
+ FRAGMENTS.set(fragmentKey, mergeNestedObjects(currentData, fragmentFromData));
273
304
  updatedKeys.push(fragmentKey);
274
305
 
275
306
  return fragmentKey;
@@ -342,6 +373,15 @@ function makeCacheObject(data: any, selections: any[], variables?: any, cacheMap
342
373
  // Because partials might have data that's not in the main fragment
343
374
  const currentData = loadFragment(fragmentKey);
344
375
 
376
+ // if (fragmentKey.startsWith('$reportFragment:3789505824043091-4255281447699102-3789105884863193')) {
377
+ // console.log('>>>>');
378
+ // console.log('>>>>');
379
+ // console.log('>>>>');
380
+ // console.log('>>>>');
381
+ // console.log(currentData);
382
+ // console.log(data);
383
+ // }
384
+
345
385
  // console.log('>>>>', fragmentKey);
346
386
  FRAGMENTS.set(fragmentKey, mergeNestedObjects(currentData, extractFragment(data, selections)));
347
387
  updatedKeys.push(fragmentKey);
@@ -405,7 +445,6 @@ function makeCacheObject(data: any, selections: any[], variables?: any, cacheMap
405
445
  // console.log(data);
406
446
  // console.log(spreads);
407
447
  // }
408
-
409
448
  FRAGMENTS.set(spreadsFragmentKey, spreads);
410
449
  }
411
450
  }
@@ -577,6 +616,21 @@ export function appendFragmentToCache(cacheData: any, testMode?: boolean) {
577
616
  if (Array.isArray(d)) {
578
617
  if (d.length === 1 && d?.[0]?.startsWith('$')) {
579
618
  mapCacheId = d[0];
619
+ } else if (Array.isArray(d[1])) {
620
+ // Use __reactiveFragmentName to make client-side data up to date
621
+ item[d[0]] = d[1].map(dr => {
622
+ if (dr.__reactiveFragmentName) {
623
+ const crFKey = `${dr.__reactiveFragmentName}:${dr.id}`;
624
+ return FRAGMENTS.get(crFKey) || dr;
625
+ }
626
+ return dr;
627
+ });
628
+ return;
629
+ } else if (d[1]?.__reactiveFragmentName) {
630
+ // Use __reactiveFragmentName to make client-side data up to date
631
+ const clientReactiveFragmentKey = `${d[1].__reactiveFragmentName}:${d[1].id}`;
632
+ item[d[0]] = FRAGMENTS.get(clientReactiveFragmentKey) || d[1];
633
+ return;
580
634
  } else {
581
635
  item[d[0]] = d[1];
582
636
  return;
@@ -604,7 +658,6 @@ export function appendFragmentToCache(cacheData: any, testMode?: boolean) {
604
658
  }
605
659
 
606
660
  const cachedFragment = loadFragment(fragmentKey);
607
-
608
661
  if (cachedFragment) {
609
662
  item = {
610
663
  ...item,
@@ -789,6 +842,15 @@ export function loadDataFromCache(
789
842
  const fragmentKey = eagerFragmentKeyMap[qryName];
790
843
  const cachedFragment = loadFragment(fragmentKey);
791
844
 
845
+ // if (fragmentKey.startsWith('$reportFragment:3789505824043091-4255281447699102-3789105884863193')) {
846
+ // console.log('>>>>');
847
+ // console.log('>>>>');
848
+ // console.log('>>>>');
849
+ // console.log('>>>>');
850
+ // console.log(cachedFragment);
851
+ // console.log(data);
852
+ // }
853
+
792
854
  if (cachedFragment) {
793
855
  data[qryName] = cachedFragment;
794
856
  }
@@ -983,7 +1045,7 @@ export function resetQuery(queryId: string, forceRefetch?: boolean, updateObserv
983
1045
  export function updateFragment(
984
1046
  updateFragmentKey: string,
985
1047
  update: any | ((cache: any) => any),
986
- replaceId?: string | null,
1048
+ replacementFragmentKey?: string | null,
987
1049
  doNotTriggerObserver?: boolean,
988
1050
  updateObservers?: UpdateObserversFn,
989
1051
  otherUpdatedFragmentKeys?: string[],
@@ -998,17 +1060,19 @@ export function updateFragment(
998
1060
  updateObj = update;
999
1061
  }
1000
1062
 
1001
- const updatedObj = { ...cache, ...updateObj };
1002
- FRAGMENTS.set(updateFragmentKey, updatedObj);
1063
+ const newUpdatedObj = { ...cache, ...updateObj };
1064
+
1065
+ FRAGMENTS.set(updateFragmentKey, newUpdatedObj);
1066
+ console.dev('✅ FRAGMENT UPDATED ->', updateFragmentKey, newUpdatedObj);
1003
1067
 
1004
- if (replaceId && replaceId !== updateFragmentKey) {
1005
- FRAGMENTS.set(replaceId, updatedObj);
1068
+ if (replacementFragmentKey && replacementFragmentKey !== updateFragmentKey) {
1069
+ FRAGMENTS.set(replacementFragmentKey, newUpdatedObj);
1006
1070
  }
1007
1071
 
1008
1072
  if (!doNotTriggerObserver && updateObservers) {
1009
1073
  let observingFragmentIds = [updateFragmentKey];
1010
1074
  if (Array.isArray(otherUpdatedFragmentKeys)) {
1011
- observingFragmentIds = observingFragmentIds.concat(otherUpdatedFragmentKeys);
1075
+ observingFragmentIds = uniq(observingFragmentIds.concat(otherUpdatedFragmentKeys));
1012
1076
  }
1013
1077
 
1014
1078
  updateObservers({
@@ -1044,10 +1108,10 @@ export function updateQuery(
1044
1108
  updateObj = update;
1045
1109
  }
1046
1110
 
1047
- const updatedObj = Array.isArray(updateObj) ? updateObj : { ...cache, ...updateObj };
1111
+ const newUpdatedObj = Array.isArray(updateObj) ? updateObj : { ...cache, ...updateObj };
1048
1112
 
1049
1113
  // console.log('UPDATING (3):', updateObj);
1050
- QUERIES.set(queryId, updatedObj);
1114
+ QUERIES.set(queryId, newUpdatedObj);
1051
1115
 
1052
1116
  if (!doNotTriggerObserver && updateObservers) {
1053
1117
  updateObservers({
@@ -21,6 +21,7 @@ export const reportSectionFragment = `fragment reportSectionFragment on ReportSe
21
21
  sectionName
22
22
  title
23
23
  description
24
+ requireFileUploads
24
25
  }`;
25
26
 
26
27
  export const reportRowDataFragment = `fragment reportRowDataFragment on ReportRowData {
@@ -0,0 +1,14 @@
1
+
2
+ export const storageFileFragment = `fragment storageFileFragment on StorageFile {
3
+ id
4
+ uri
5
+ size
6
+ contentType
7
+ at
8
+ name
9
+ description
10
+ aiNote
11
+
12
+ # client-side required fields
13
+ uploadStatus
14
+ }`;
@@ -4,5 +4,5 @@ export * from './authMutations';
4
4
  export * from './billingMutations';
5
5
  export * from './logMutations';
6
6
  export * from './organizationMutations';
7
- export * from './otherMutations';
7
+ export * from './storageMutations';
8
8
  export * from './userAuthMutations';
@@ -0,0 +1,36 @@
1
+ import { gql } from 'graphql-tag';
2
+
3
+ export const createSignedUploadUrlMtn = gql`
4
+ mutation createSignedUploadUrl (
5
+ $temporaryId: String!
6
+ $organizationId: GenericID!
7
+ $fileName: String!
8
+ $contentType: String!
9
+ $fileSize: Int!
10
+ $uploadIntent: StorageIntentObject!
11
+ ) {
12
+ createSignedUploadUrl (
13
+ temporaryId: $temporaryId
14
+ organizationId: $organizationId
15
+ fileName: $fileName
16
+ contentType: $contentType
17
+ fileSize: $fileSize
18
+ uploadIntent: $uploadIntent
19
+ ) {
20
+ signedUrl
21
+ fileUri
22
+ }
23
+ }
24
+ `;
25
+
26
+ export const deleteStorageFileMtn = gql`
27
+ mutation deleteStorageFile (
28
+ $organizationId: GenericID!
29
+ $fileUri: String!
30
+ ) {
31
+ deleteStorageFile (
32
+ organizationId: $organizationId
33
+ fileUri: $fileUri
34
+ )
35
+ }
36
+ `;
@@ -1,5 +1,6 @@
1
1
  import { gql } from 'graphql-tag';
2
2
  import { reportColumnDataFragment, reportFragment, reportAvailabilityFragment, reportRowDataFragment, reportSectionFragment } from '../fragments/reportFragments';
3
+ import { storageFileFragment } from '../fragments/storageFragments';
3
4
 
4
5
  export const reportsQry = gql`
5
6
  query reports (
@@ -17,6 +18,10 @@ query reports (
17
18
  sections {
18
19
  ...reportSectionFragment
19
20
 
21
+ files {
22
+ ...storageFileFragment
23
+ }
24
+
20
25
  rows {
21
26
  ...reportRowDataFragment
22
27
 
@@ -41,6 +46,7 @@ query reports (
41
46
 
42
47
  ${reportFragment}
43
48
  ${reportSectionFragment}
49
+ ${storageFileFragment}
44
50
  ${reportRowDataFragment}
45
51
  ${reportColumnDataFragment}
46
52
  `;
package/hooks/index.ts CHANGED
@@ -149,6 +149,7 @@ export function useWatchQuery(
149
149
 
150
150
  if (qryTriggerTime) {
151
151
  clearQueryResetStatus(queryName, variablesKey);
152
+ console.dev(`... (1) Query [${queryName}:${variablesKey}] is being force refetched via observer.`);
152
153
  return [lastUpdatedCount + 1, true, qryTriggerTime];
153
154
  }
154
155
  }
@@ -172,6 +173,10 @@ export function useWatchQuery(
172
173
  newUpdatedCount += 1;
173
174
  }
174
175
 
176
+ if (forceRefetch) {
177
+ console.dev(`... (2) Query [${matchedQueryId}] is being force refetched via observer.`);
178
+ }
179
+
175
180
  return [newUpdatedCount, forceRefetch, ''];
176
181
  }
177
182
 
@@ -220,7 +225,7 @@ export function useReactiveFragment(
220
225
  qryObsCount?: number | boolean,
221
226
  otherCheck?: (latestData: any, updatedKeys: any[]) => boolean,
222
227
  ignoreIDWarning?: boolean,
223
- // doTest?: boolean
228
+ isTest?: boolean
224
229
  ) {
225
230
 
226
231
  const fragmentObserver = useFragmentObserverValue();
@@ -332,8 +337,11 @@ export function useReactiveFragment(
332
337
  }
333
338
 
334
339
  const fragmentData = loadFragment(isMapped ? key[0] : key);
335
- // console.log('fragmentKey', key);
336
- // console.log('fragmentData', fragmentData);
340
+
341
+ // if (isTest) {
342
+ // console.log('fragmentKey', key);
343
+ // console.log('fragmentData', fragmentData);
344
+ // }
337
345
 
338
346
  if (fragmentData) {
339
347
  if (isMapped) {
@@ -378,6 +386,12 @@ export function useReactiveFragment(
378
386
  // }
379
387
  // }, [updateQueryCount]);
380
388
 
389
+ // if (isTest) {
390
+ // console.log('dataId', dataId);
391
+ // console.log('1', changedData);
392
+ // console.log('2', data);
393
+ // }
394
+
381
395
  return changedData.data ?? null;
382
396
  }
383
397
 
@@ -863,7 +877,7 @@ export function useQuery(
863
877
  timeThresh = QUERY_EXPIRE_TIMES[queryName] || QUERY_EXPIRE_TIMES.__default;
864
878
  }
865
879
 
866
- // console.log('>>', queryName, timeDiff, timeThresh);
880
+ // console.log('>>', queryName, timeDiff, timeThresh, timeDiff > timeThresh);
867
881
 
868
882
  if (
869
883
  tracker.current.init &&
@@ -4,7 +4,7 @@ import { availableReportsQry, reportsQry } from '../gql/queries/reportQueries';
4
4
  import type { UseQueryParams } from '../types';
5
5
 
6
6
  /**
7
- * Get reactive log fragment
7
+ * Get reactive report fragment
8
8
  */
9
9
 
10
10
  export function useReactiveReportFragment(reportId: string, currentData?: any, queryCount?: number) {
@@ -25,7 +25,7 @@ export function useReports(
25
25
  variables: {
26
26
  organizationId: string;
27
27
  filter: ReportsFilterArgs;
28
- sort: ReportsSortEnum;
28
+ sort?: ReportsSortEnum;
29
29
  },
30
30
  params: UseQueryParams = {},
31
31
  ) {
@@ -0,0 +1,56 @@
1
+ import type { UseMutationParams } from '@jsb188/graphql/types.d';
2
+ import { OpenModalPopUpFn } from '@jsb188/react/states';
3
+ import { updateFragment } from '../cache/index';
4
+ import { createSignedUploadUrlMtn, deleteStorageFileMtn } from '../gql/mutations/storageMutations';
5
+ import { useMutation } from './index';
6
+
7
+ /**
8
+ * Get signed URL for file uploads
9
+ */
10
+
11
+ export function useCreateSignedUploadUrl(params: UseMutationParams = {}, openModalPopUp?: OpenModalPopUpFn) {
12
+
13
+ const [createSignedUploadUrl, mtnValues, mtnHandlers, updateObservers] = useMutation(
14
+ createSignedUploadUrlMtn,
15
+ {
16
+ openModalPopUp,
17
+ ...params,
18
+ },
19
+ );
20
+
21
+ return {
22
+ createSignedUploadUrl,
23
+ updateObservers,
24
+ ...mtnValues,
25
+ ...mtnHandlers,
26
+ };
27
+ }
28
+
29
+ /**
30
+ * Delete a storage file
31
+ */
32
+
33
+ export function useDeleteStorageFile(params: UseMutationParams = {}, openModalPopUp?: OpenModalPopUpFn) {
34
+
35
+ const { onCompleted, ...rest } = params;
36
+ const [deleteStorageFile, mtnValues, mtnHandlers, updateObservers] = useMutation(
37
+ deleteStorageFileMtn,
38
+ {
39
+ openModalPopUp,
40
+ onCompleted: (data, dataMtnValues, variables) => {
41
+ if (data?.deleteStorageFile) {
42
+ updateFragment(`$storageFileFragment:${variables.fileUri}`, { __deleted: true }, null, false, updateObservers);
43
+ }
44
+ onCompleted?.(data, dataMtnValues, variables);
45
+ },
46
+ ...rest,
47
+ },
48
+ );
49
+
50
+ return {
51
+ deleteStorageFile,
52
+ updateObservers,
53
+ ...mtnValues,
54
+ ...mtnHandlers,
55
+ };
56
+ }
@@ -0,0 +1,21 @@
1
+ import { useReactiveFragment } from '../client';
2
+
3
+ /**
4
+ * Get reactive log fragment
5
+ */
6
+
7
+ export function useReactiveStorageFragment(storageId: string, currentData?: any, queryCount?: number) {
8
+ return useReactiveFragment(
9
+ currentData,
10
+ [
11
+ `$storageFileFragment:${storageId}`,
12
+
13
+ // By having the second paramter as null, we only observe the reactive changes without setting the data
14
+ // [`$logArableFragment:${storageId}`, null],
15
+
16
+ // This is not needed because $logEntryFragment has spread data
17
+ // [`$accountFragment:${storageId}`, 'account']
18
+ ],
19
+ queryCount,
20
+ );
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsb188/graphql",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "GraphQL client for react, using recoil",
5
5
  "license": "ISC",
6
6
  "author": "jsb188",
@@ -16,6 +16,7 @@
16
16
  "./fragments/other": "./gql/fragments/otherFragments.ts",
17
17
  "./fragments/product": "./gql/fragments/productFragments.ts",
18
18
  "./fragments/report": "./gql/fragments/reportFragments.ts",
19
+ "./fragments/storage": "./gql/fragments/storageFragments.ts",
19
20
  "./hooks": "./hooks/",
20
21
  "./hooks/use-action-qry": "./hooks/use-action-qry.ts",
21
22
  "./hooks/use-aiChat-qry": "./hooks/use-aiChat-qry.ts",
@@ -24,11 +25,13 @@
24
25
  "./hooks/use-organization-qry": "./hooks/use-organization-qry.ts",
25
26
  "./hooks/use-product-qry": "./hooks/use-product-qry.ts",
26
27
  "./hooks/use-report-qry": "./hooks/use-report-qry.ts",
28
+ "./hooks/use-storage-qry": "./hooks/use-storage-qry.ts",
27
29
  "./hooks/use-account-mtn": "./hooks/use-account-mtn.ts",
28
30
  "./hooks/use-aiChat-mtn": "./hooks/use-aiChat-mtn.ts",
29
31
  "./hooks/use-auth-mtn": "./hooks/use-auth-mtn.ts",
30
32
  "./hooks/use-log-mtn": "./hooks/use-log-mtn.ts",
31
33
  "./hooks/use-organization-mtn": "./hooks/use-organization-mtn.ts",
34
+ "./hooks/use-storage-mtn": "./hooks/use-storage-mtn.ts",
32
35
  "./mutations": "./gql/mutations/index.ts",
33
36
  "./queries": "./gql/queries/index.ts",
34
37
  "./cache": "./cache/index.ts",
@@ -45,7 +48,7 @@
45
48
  "graphql-tag": "^2.12.6"
46
49
  },
47
50
  "peerDependencies": {
48
- "@jsb188/app": "1.1.6",
49
- "@jsb188/react": "1.1.6"
51
+ "@jsb188/app": "1.1.8",
52
+ "@jsb188/react": "1.1.8"
50
53
  }
51
54
  }
@@ -1,29 +0,0 @@
1
- import { gql } from 'graphql-tag';
2
-
3
- export const prepareFileUploadMtn = gql`
4
- mutation prepareFileUpload (
5
- $files: [FilePrepareInput]!
6
- ) {
7
- prepareFileUpload (
8
- files: $files
9
- ) {
10
- id
11
- fileName
12
- uri
13
- token
14
- }
15
- }
16
- `;
17
-
18
- export const finishFileUploadMtn = gql`
19
- mutation finishFileUpload (
20
- $fileIds: [GenericID]!
21
- ) {
22
- finishFileUpload (
23
- fileIds: $fileIds
24
- ) {
25
- id
26
- uri
27
- }
28
- }
29
- `;