Skip to content

Commit

Permalink
190 error handling in mutations (#191)
Browse files Browse the repository at this point in the history
* correct handling of errors

* Release 1.0.0-edge.16
  • Loading branch information
vernaillen authored Aug 26, 2024
1 parent e29f02e commit 079d9e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wpnuxt/core",
"version": "1.0.0-edge.15",
"version": "1.0.0-edge.16",
"description": "WPNuxt",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/useWPContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const _useWPContent = async <T>(operation: OperationTypeNode, queryName: string,
}
})
return {
data: transformData(data, nodes, fixImagePaths),
data: error ? undefined : transformData(data, nodes, fixImagePaths),
error
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/server/api/wpContent.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineCachedEventHandler(async (event: H3Event) => {
}).then((v: GraphqlResponse) => {
return {
data: v.data,
errors: v.errors || []
error: v.errors || undefined
}
})
}, {
Expand Down

0 comments on commit 079d9e5

Please sign in to comment.