Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
339 stars 42 forks source link

Allow type safe usage of useGqlError #468

Closed some-user123 closed 1 week ago

some-user123 commented 5 months ago

Your use case

When defining a custom error handler using useGqlError I'd like to write a type safe function, e.g.:

Instead of:

useGqlError((err) => {
    console.error(err)
 })

I want to write:

useGqlError((err: GqlError) => {
    // Access err in a type safe way...
 })

The solution you'd like

I'd like to import the type GqlError. Could not find a working export. (Ideally, this would be reflected in the docs)

Possible alternatives

No response

Additional information

No response

mariopries commented 4 months ago

same here

image

m0nch1 commented 2 weeks ago

It seems to me that GqlError could be included in the dist in some way... Nuxt Module Builder might be relevant too?

m0nch1 commented 1 week ago

I made a PR to export the type

Diizzayy commented 1 week ago

@mariopries Thanks for taking the time to address this! Your fix has been merged into the latest release.