Skip to content

Commit

Permalink
192 generalsettings query returns error (#193)
Browse files Browse the repository at this point in the history
* correct handling of errors

* Release 1.0.0-edge.16

* don't fetch settings email, it returns an error when not authenticated

* always return data as well as error, as both can exist at the same time.  e.g. email field in GeneralSettings

* chore: update dependencies -
  • Loading branch information
vernaillen authored Aug 29, 2024
1 parent 079d9e5 commit 321edb7
Show file tree
Hide file tree
Showing 5 changed files with 701 additions and 527 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"dependencies": {
"@nuxt/kit": "3.13.0",
"@vueuse/nuxt": "^11.0.0",
"@vueuse/nuxt": "^11.0.3",
"defu": "^6.1.4",
"graphql": "^16.9.0",
"nuxt-graphql-middleware": "4.1.1",
Expand All @@ -65,14 +65,14 @@
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.3.3",
"@graphql-codegen/typescript-operations": "^4.2.3",
"@nuxt/devtools": "^1.3.14",
"@nuxt/eslint-config": "^0.5.2",
"@nuxt/devtools": "^1.4.1",
"@nuxt/eslint-config": "^0.5.3",
"@nuxt/module-builder": "^0.8.3",
"@nuxt/schema": "3.13.0",
"@nuxt/test-utils": "^3.14.1",
"@rollup/rollup-linux-arm64-gnu": "^4.20.0",
"@rollup/rollup-linux-arm64-musl": "^4.20.0",
"@types/node": "22.5.0",
"@rollup/rollup-linux-arm64-gnu": "^4.21.1",
"@rollup/rollup-linux-arm64-musl": "^4.21.1",
"@types/node": "22.5.1",
"@vitest/coverage-v8": "^2.0.5",
"@vue/test-utils": "^2.4.6",
"@wordpress/env": "^10.6.0",
Expand All @@ -88,7 +88,7 @@
"vite": "^5.4.2",
"vitest": "^2.0.5",
"vue-docgen-web-types": "^0.1.8",
"vue-tsc": "2.0.29"
"vue-tsc": "2.1.0"
},
"peerDependencies": {
"consola": "^3.2.3",
Expand Down
5 changes: 4 additions & 1 deletion playground/app/pages/composables.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const prefix = useRuntimeConfig().public.wpNuxt.generateComposables?.prefix
const { data: posts } = await usePosts()
const { data: postsLimited } = await usePosts({ limit: 1 })
const { data: postByUri } = await usePostByUri({ uri: 'hello-world' })
const { data: settings } = await useGeneralSettings()
const { data: settings, error } = await useGeneralSettings()
</script>

<template>
Expand Down Expand Up @@ -48,6 +48,9 @@ const { data: settings } = await useGeneralSettings()
<strong>{{ key }}:</strong> {{ value }}
</li>
</ul>
The email field in GeneralSettings can't be fetched without authentication.<br>
The other data (see above) is returned anyway, and an error is thrown about the mail field:<br>
<pre>{{ error }}</pre>
</UContainer>
</NuxtLayout>
</template>
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@iconify-json/mdi": "^1.1.68",
"@iconify-json/svg-spinners": "^1.1.3",
"@iconify-json/uil": "^1.1.9",
"@nuxt/eslint": "^0.5.2",
"@nuxt/image": "^1.7.0",
"@nuxt/eslint": "^0.5.3",
"@nuxt/image": "^1.7.1",
"@nuxt/ui-pro": "^1.4.1",
"nuxt": "^3.13.0",
"vite-plugin-eslint2": "^4.4.0"
Expand Down
Loading

0 comments on commit 321edb7

Please sign in to comment.