code: function insertEdgeAfter(
    record: RecordProxy,
    newEdge: RecordProxy,
    cursor?: ?string,
  ): void {
    const {CURSOR, EDGES} = RelayConnectionInterface.get();
  
    const edges = record.getLinkedRecords(EDGES);
    if (!edges) {
      record.setLinkedRecords([newEdge], EDGES);
      return;
    }
    let nextEdges;
    if (cursor == null) {
      nextEdges = edges.concat(newEdge);
    } else {
      nextEdges = [];
      let foundCursor = false;
      for (let ii = 0; ii < edges.length; ii++) {
        const edge = edges[ii];
        nextEdges.push(edge);
        if (edge == null) {
          continue;
        }
        const edgeCursor = edge.getValue(CURSOR);
        if (cursor === edgeCursor) {
          nextEdges.push(newEdge);
          foundCursor = true;
        }
      }
      if (!foundCursor) {
        nextEdges.push(newEdge);
      }
    }
    record.setLinkedRecords(nextEdges, EDGES);
  }
docs: @public
  
  Inserts an edge after the given cursor, or at the end of the list if no
  cursor is provided.
  
  Example:
  
  Given that data has already been fetched on some user `<id>` on the `friends`
  field:
  
  ```
  fragment FriendsFragment on User {
  friends(first: 10) @connection(key: "FriendsFragment_friends") {
  edges {
  node {
  id
  }
  }
  }
  }
  ```
  
  An edge can be appended with:
  
  ```
  store => {
  const user = store.get('<id>');
  const friends = RelayConnectionHandler.getConnection(user, 'FriendsFragment_friends');
  const edge = store.create('<edge-id>', 'FriendsEdge');
  RelayConnectionHandler.insertEdgeAfter(friends, edge);
  }
  ```