Skip to content

Commit e978cff

Browse files
authored
Part8: Handling mutation errors
fix the function to get error message
1 parent 03944a7 commit e978cff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/8/en/part8b.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ const PersonForm = ({ setError }) => {
598598
refetchQueries: [ {query: ALL_PERSONS } ],
599599
// highlight-start
600600
onError: (error) => {
601-
const messages = error.graphQLErrors.map(e => e.message).join('\n')
601+
const messages = error.message
602602
setError(messages)
603603
}
604604
// highlight-end

0 commit comments

Comments
 (0)