How to use the relay-runtime.ConnectionHandler.deleteNode function in relay-runtime

To help you get started, we’ve selected a few relay-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github relay-tools / found-relay / src / mutations / ChangeTodoStatusMutation.js View on Github external
function sharedUpdater(store, user, todoProxy) {
  // In principle this could add to the active connection, but such an
  // interaction is not possible from the front end.
  const userProxy = store.get(user.id);
  const status = todoProxy.getValue('complete') ? 'active' : 'completed';
  const connection = ConnectionHandler.getConnection(
    userProxy,
    'TodoList_todos',
    { status },
  );
  if (connection) {
    ConnectionHandler.deleteNode(connection, todoProxy.getValue('id'));
  }
}
github magma / magma / symphony / app / fbcnms-projects / inventory / app / components / configure / LocationTypeItem.js View on Github external
store => {
            // $FlowFixMe (T62907961) Relay flow types
            const rootQuery = store.getRoot();
            const locationTypes = ConnectionHandler.getConnection(
              rootQuery,
              'Catalog_locationTypes',
            );
            ConnectionHandler.deleteNode(
              // $FlowFixMe (T62907961) Relay flow types
              locationTypes,
              this.props.locationType.id,
            );
            // $FlowFixMe (T62907961) Relay flow types
            store.delete(this.props.locationType.id);
          },
        );
github magma / magma / symphony / app / fbcnms-projects / inventory / app / components / configure / ServiceTypeItem.js View on Github external
store => {
            // $FlowFixMe (T62907961) Relay flow types
            const rootQuery = store.getRoot();
            const serviceTypes = ConnectionHandler.getConnection(
              rootQuery,
              'ServiceTypes_serviceTypes',
            );
            ConnectionHandler.deleteNode(
              // $FlowFixMe (T62907961) Relay flow types
              serviceTypes,
              this.props.serviceType.id,
            );
            // $FlowFixMe (T62907961) Relay flow types
            store.delete(this.props.serviceType.id);
          },
        );
github berty / berty / client / react-native / common / relay / updater.js View on Github external
delete: id => {
      const root = store.getRoot()
      const connection = ConnectionHandler.getConnection(root, name, args)
      ConnectionHandler.deleteNode(connection, id)
    },
    add: (edgeType, id) => {
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / settings / tags / TagPopover.js View on Github external
updater: (store) => {
        const container = store.getRoot();
        const payload = store.getRootField('tagEdit');
        const userProxy = store.get(container.getDataID());
        const conn = ConnectionHandler.getConnection(
          userProxy,
          'Pagination_tags',
          this.props.paginationOptions,
        );
        ConnectionHandler.deleteNode(conn, payload.getValue('delete'));
      },
      onCompleted: () => {
github coralproject / talk / src / core / client / admin / mutations / ApproveCommentMutation.ts View on Github external
connections.forEach(con =>
          ConnectionHandler.deleteNode(con, input.commentID)
        );
github magma / magma / symphony / app / fbcnms-projects / inventory / app / components / configure / WorkOrderTypeItem.js View on Github external
store => {
            const rootQuery = store.getRoot();
            const workOrderTypes = ConnectionHandler.getConnection(
              rootQuery,
              'Configure_workOrderTypes',
            );
            ConnectionHandler.deleteNode(
              workOrderTypes,
              this.props.workOrderType.id,
            );
            store.delete(this.props.workOrderType.id);
          },
        );
github taion / relay-todomvc / src / mutations / RemoveTodoMutation.js View on Github external
['any', 'active', 'completed'].forEach((status) => {
    const connection = ConnectionHandler.getConnection(
      userProxy, 'TodoList_todos', { status },
    );
    if (connection) {
      ConnectionHandler.deleteNode(connection, deletedId);
    }
  });
}