<commit_before>import Relay from 'react-relay';

class NoticeDismiss extends Relay.Mutation {
  static fragments = {
    notice: () => Relay.QL`
      fragment on Notice {
        id
      }
    `
  }

  getMutation() {
    return Relay.QL`
      mutation {
        noticeDismiss
      }
    `;
  }

  getFatQuery() {
    return Relay.QL`
      fragment on NoticeDismissPayload {
        notice {
          dismissedAt
        }
      }
    `;
  }

  getOptimisticResponse() {
    return {
      notice: {
        dismissedAt: new Date()
      }
    };
  }

  getConfigs() {
    return [{
      type: 'FIELDS_CHANGE',
      fieldIDs: {
        notice: this.props.notice.id
      }
    }];
  }

  getVariables() {
    return { id: this.props.notice.id };
  }
}

export default NoticeDismiss;<commit_msg>Fixed getOptimisticResponse for the NoticeDismiss mutation<commit_after>import Relay from 'react-relay';

class NoticeDismiss extends Relay.Mutation {
  static fragments = {
    notice: () => Relay.QL`
      fragment on Notice {
        id
      }
    `
  }

  getMutation() {
    return Relay.QL`
      mutation {
        noticeDismiss
      }
    `;
  }

  getFatQuery() {
    return Relay.QL`
      fragment on NoticeDismissPayload {
        notice {
          dismissedAt
        }
      }
    `;
  }

  getOptimisticResponse() {
    return {
      notice: {
        id: this.props.notice.id,
        dismissedAt: (new Date()).toString()
      }
    };
  }

  getConfigs() {
    return [{
      type: 'FIELDS_CHANGE',
      fieldIDs: {
        notice: this.props.notice.id
      }
    }];
  }

  getVariables() {
    return { id: this.props.notice.id };
  }
}

export default NoticeDismiss;
{'fraction_non_alphanumeric': 0.11202830188679246, 'fraction_numerical': 0.0, 'mean_word_length': 1.772875816993464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4867073', 'n_tokens_mistral': 564, 'n_tokens_neox': 557, 'n_words': 104}