UNPKG

relay-utils

Version:

Utilities for working with Relay (modern) in general, and the Relay store in particular.

12 lines (10 loc) 280 B
// @flow import type { RecordProxy } from 'relay-runtime/store/RelayStoreTypes'; export function setFieldsOnRecord( record: RecordProxy, fieldsObj: { [key: string]: mixed } ): void { Object.keys(fieldsObj).forEach(key => { record.setValue(fieldsObj[key], key); }); }