You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for resolveInput for field hooks seems a bit misleading. When it says
The return of resolveInput can be a Promise or an Object. It should resolve to the same structure as the resolvedData. The result is passed to the next function in the execution order.
and gives as an example
const resolveInput = ({
operation,
existingItem,
originalInput,
resolvedData,
context,
actions,
}) => {
// Input resolution logic
// Object returned is used in place of resolvedData
return resolvedData;
};
instead it would seem that you can't return resolvedData but rather the field inside resolvedData for which you're writing a hook. For instance, in my Article list I had this field
The documentation for
resolveInput
for field hooks seems a bit misleading. When it saysand gives as an example
instead it would seem that you can't return
resolvedData
but rather the field insideresolvedData
for which you're writing a hook. For instance, in myArticle
list I had this fieldbut on saving the
Article
I kept getting this error within the AdminUIThe same thing happened when I used the
resolveInput
hook on another field,thus it wasn't unique to the
Wysiwyg
field type.The solution was not to return
resolvedData
, butresolvedData.text
(orresolvedData.title
, respectively).I think the docs should be changed, since the example at least doesn't make it clear what one should do.
The text was updated successfully, but these errors were encountered: