Open madebyfabian opened 1 year ago
Another possible workaround is to import return type:
import type { ListOrderPacketsInTransportQuery } from '#gql'
export default defineTask({
async run({ payload, context }) {
const { orderItems }: ListOrderPacketsInTransportQuery = await GqlListOrderPacketsInTransport()
I remember it worked in a past too. Considering many other server-side related issues it seems @Diizzayy does not use GraphQL server-side in his projects. ;-) Anything we can do for you to help you with server-side features and bugs?
Environment
Describe the bug
I want to use a graphql operation server-side.
This works, but is not typed:
I tried to import it like this. Now types work, But this breaks the runtime. Since I am importing types as a const.
export default defineEventHandler(async event => { const data = (await GqlSendContactFormRequest()) as typeof RequestT
})