diff --git a/docs/content/2.guide/2.directory-structure/1.server.md b/docs/content/2.guide/2.directory-structure/1.server.md index e4ddde4a70..8503aa043f 100644 --- a/docs/content/2.guide/2.directory-structure/1.server.md +++ b/docs/content/2.guide/2.directory-structure/1.server.md @@ -158,7 +158,7 @@ Sample query `/api/query?param1=a¶m2=b` ```ts [server/api/query.get.ts] export default defineEventHandler((event) => { - const query = useQuery(event) + const query = getQuery(event) return { a: query.param1, b: query.param2 } }) ``` diff --git a/examples/app/error-handling/server/middleware/error.ts b/examples/app/error-handling/server/middleware/error.ts index 0575be5532..8977ed8efd 100644 --- a/examples/app/error-handling/server/middleware/error.ts +++ b/examples/app/error-handling/server/middleware/error.ts @@ -1,7 +1,7 @@ -import { useQuery, defineMiddleware } from 'h3' +import { getQuery, defineMiddleware } from 'h3' export default defineMiddleware((req, res, next) => { - if ('api' in useQuery(req)) { + if ('api' in getQuery(req)) { throw new Error('Server middleware error') } next() diff --git a/examples/composables/use-fetch/server/api/[...hello].ts b/examples/composables/use-fetch/server/api/[...hello].ts index 00305ed25b..daf60d2f62 100644 --- a/examples/composables/use-fetch/server/api/[...hello].ts +++ b/examples/composables/use-fetch/server/api/[...hello].ts @@ -1,4 +1,4 @@ export default defineEventHandler(event => ({ path: '/api/' + event.context.params.hello, - query: useQuery(event) + query: getQuery(event) })) diff --git a/examples/experimental/wasm/server/api/sum.ts b/examples/experimental/wasm/server/api/sum.ts index d59d310ca5..6786197013 100644 --- a/examples/experimental/wasm/server/api/sum.ts +++ b/examples/experimental/wasm/server/api/sum.ts @@ -7,7 +7,7 @@ export default defineLazyHandler(async () => { ) return (event) => { - const { a = 0, b = 0 } = useQuery(event) + const { a = 0, b = 0 } = getQuery(event) return { sum: sum(a, b) } } })