@quesmed/types-rn 2.6.53 → 2.6.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.53",
3
+ "version": "2.6.55",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -23,11 +23,13 @@ const updateCacheOnUpsertChapterNote = (cache, result, options) => {
23
23
  if (!variables || !upsertChapterNote) {
24
24
  return;
25
25
  }
26
- const { id, ...updatedData } = upsertChapterNote;
27
26
  cache.writeFragment({
28
- id: cache.identify({ id, __typename: 'UserChapterNote' }),
27
+ id: cache.identify({
28
+ id: variables.chapterId,
29
+ __typename: 'Chapter',
30
+ }),
29
31
  data: {
30
- ...updatedData,
32
+ userNote: upsertChapterNote,
31
33
  },
32
34
  fragment: fragments_1.UPSERT_CHAPTER_NOTE_FRAGMENT,
33
35
  });
@@ -53,6 +53,7 @@ export type IQuestionCommentRemoveData = RestrictedData<graphqlNormalize & IQues
53
53
  * addQuestionHighlight
54
54
  */
55
55
  export interface IAddQuestionHighlightVar {
56
+ marksheetId?: number;
56
57
  input: {
57
58
  questionId: Id;
58
59
  highlights: IHighlight[];
@@ -60,5 +61,5 @@ export interface IAddQuestionHighlightVar {
60
61
  }
61
62
  export type IAddQuestionHighlightData = RestrictedData<(graphqlNormalize & IQuestionHighlights)[], 'addQuestionHighlight'>;
62
63
  export declare const ADD_QUESTION_HIGHLIGHT: import("@apollo/client").DocumentNode;
63
- export declare const updateQuestionHighlights: (typeId: EQuestionType) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IAddQuestionHighlightData>, options: ApolloUpdateOptions) => void;
64
+ export declare const updateQuestionHighlights: (typeId: EQuestionType) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IAddQuestionHighlightData>, options: ApolloUpdateOptions<IAddQuestionHighlightVar>) => void;
64
65
  export {};
@@ -336,9 +336,12 @@ const optimisticQuestionCommentRemove = (comments, input, parentId) => {
336
336
  };
337
337
  exports.optimisticQuestionCommentRemove = optimisticQuestionCommentRemove;
338
338
  exports.ADD_QUESTION_HIGHLIGHT = (0, client_1.gql) `
339
- mutation AddHighlight($input: [AddQuestionHighlightInput!]!) {
339
+ mutation AddHighlight(
340
+ $input: [AddQuestionHighlightInput!]!
341
+ $marksheetId: Int
342
+ ) {
340
343
  restricted {
341
- addQuestionHighlight(input: $input) {
344
+ addQuestionHighlight(input: $input, marksheetId: $marksheetId) {
342
345
  id
343
346
  questionId
344
347
  userId
@@ -360,20 +363,19 @@ const updateQuestionHighlights = (typeId) => (cache, result, options) => {
360
363
  if (!variables || !addQuestionHighlight) {
361
364
  return;
362
365
  }
363
- const { input } = variables;
364
366
  try {
365
- input.forEach(({ questionId }) => {
367
+ for (const { questionId, highlights } of variables.input) {
366
368
  cache.writeFragment({
367
369
  id: cache.identify({
368
370
  id: questionId,
369
371
  __typename: (0, exports.getQuestionTypeName)(typeId),
370
372
  }),
371
373
  data: {
372
- highlights: addQuestionHighlight[0].highlights,
374
+ highlights,
373
375
  },
374
376
  fragment: fragments_1.QUESTION_WITH_HIGHLIGHT_FIELDS,
375
377
  });
376
- });
378
+ }
377
379
  }
378
380
  catch (error) {
379
381
  console.error(error);