Helper function to check if the document is being created from an incoming reference.
It will be used in the initialValue callback to determine if the document is being created from an incoming reference.
example:
defineType({ name:'book', type:'document', fields: [...], initialValue: (params) => { // If the document is being created from an incoming reference, return the reference // Otherwise, return undefined return { author:isIncomingReferenceCreation(params) ? params.reference : undefined, } }, })
Helper function to check if the document is being created from an incoming reference. It will be used in the initialValue callback to determine if the document is being created from an incoming reference.
example: