Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow type safe usage of useGqlError #468

Closed
some-user123 opened this issue Jan 25, 2024 · 4 comments
Closed

Allow type safe usage of useGqlError #468

some-user123 opened this issue Jan 25, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@some-user123
Copy link

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

@some-user123 some-user123 added the enhancement New feature or request label Jan 25, 2024
@mariopries
Copy link

same here

image

@m0nch1
Copy link
Contributor

m0nch1 commented Jun 19, 2024

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

@m0nch1
Copy link
Contributor

m0nch1 commented Jun 21, 2024

I made a PR to export the type

@Diizzayy
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants