none
in RRS feed

  • Question

  • e.push(c),f.push(c));break;case"RANGE_ADD":c=h(a,b);c&&(e.push(c),f.push(c));break;case"RANGE_DELETE":c=i(a,b);c&&(e.push(c),f.push(c));break}});return{optimisticUpdater:function(a,b){e.forEach(function(c){c(a,b)})},updater:function(a,b){f.forEach(function(c){c(a,b)})}}}function g(a,b){var c=a.deletedIDFieldName,d=k(b);return!d?null:function(a,b){b=a.getRootField(d);if(!b)return;b=b.getValue(c);b=Array.isArray(b)?b:[b];b.forEach(function(b){b&&typeof b==="string"&&a["delete"](b)})}}function h(a,c){__p&&__p();var d=a.parentID,e=a.connectionInfo,f=a.edgeName;if(!d){b("warning")(!1,"RelayDeclarativeMutationConfig: For mutation config RANGE_ADD to work you must include a parentID");return null}var g=k(c);return!e||!g?null:function(a,c){__p&&__p();c=a.get(d);if(!c)return;var h=a.getRootField(g);if(!h)return;h=h.getLinkedRecord(f);for(var i=e,j=Array.isArray(i),k=0,i=j?i:i[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{k=i.next();if(k.done)break;l=k.value}l=l;if(!h)continue;var m=b("relay-runtime/handlers/connection/RelayConnectionHandler").getConnection(c,l.key,l.filters);if(!m)continue;var n=b("relay-runtime/handlers/connection/RelayConnectionHandler").buildConnectionEdge(a,m,h);if(!n)continue;switch(l.rangeBehavior){case"append":b("relay-runtime/handlers/connection/RelayConnectionHandler").insertEdgeAfter(m,n);break;case"ignore":break;case"prepend":b("relay-runtime/handlers/connection/RelayConnectionHandler").insertEdgeBefore(m,n);break;default:b("warning")(!1,"RelayDeclarativeMutationConfig: RANGE_ADD range behavior `%s` will not work as expected in RelayModern, supported range behaviors are 'append', 'prepend', and 'ignore'.",l.rangeBehavior);break}}}}function i(a,c){__p&&__p();var d=a.parentID,e=a.connectionKeys,f=a.pathToConnection,g=a.deletedIDFieldName;if(!d){b("warning")(!1,"RelayDeclarativeMutationConfig: For mutation config RANGE_DELETE to work you must include a parentID");return null}var h=k(c);return!h?null:function(a,b){__p&&__p();if(!b)return;var c=[];b=b[h];if(b&&Array.isArray(g)){for(var i=g,k=Array.isArray(i),l=0,i=k?i:i[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var m;if(k){if(l>=i.length)break;m=i[l++]}else{l=i.next();if(l.done)break;m=l.value}m=m;b&&typeof b==="object"&&(b=b[m])}Array.isArray(b)?b.forEach(function(a){a&&a.id&&typeof a==="object"&&typeof a.id==="string"&&c.push(a.id)}):b&&b.id&&typeof b.id==="string"&&c.push(b.id)}else b&&typeof g==="string"&&typeof b==="object"&&(b=b[g],typeof b==="string"?c.push(b):Array.isArray(b)&&b.forEach(function(a){typeof a==="string"&&c.push(a)}));j(d,e,f,a,c)}}function j(a,c,d,e,f){__p&&__p();b("warning")(c,"RelayDeclarativeMutationConfig: RANGE_DELETE must provide a connectionKeys");e=e.get(a);if(!e)return;if(d.length<2){b("warning")(!1,"RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection must include at least parent and connection");return}var g=e;for(var e=1;e<d.length-1;e++)g&&(g=g.getLinkedRecord(d[e]));if(!c||!g){b("warning")(!1,"RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection is incorrect. Unable to find connection with parentID: %s and path: %s",a,d.toString());return}a=function(){__p&&__p();if(i){if(j>=h.length)return"break";e=h[j++]}else{j=h.next();if(j.done)return"break";e=j.value}var a=e,c=b("relay-
    Friday, July 19, 2019 7:07 AM