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

Auto-Import all Types of Queries and Fragments #489

Open
arcs- opened this issue May 30, 2024 · 0 comments
Open

Auto-Import all Types of Queries and Fragments #489

arcs- opened this issue May 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@arcs-
Copy link

arcs- commented May 30, 2024

Your use case

On a root page we have a query that gets executed and split into fragments; we then pass down the data into components. To have type-safety we define the props with the fragment type

// child component
import type { ComponentsProductSliderFragment } from '#gql'

const props = defineProps<{
  data: Enforce<ComponentsProductSliderFragment>
}>()

The solution you'd like

Currently we have to define the import with import type { ComponentsProductSliderFragment } from '#gql'. I'd much rather have this one also present in the index.d.ts that gets auto imported with Nuxt. So that we have easy access to the query definitions, fragments and scalars.

Possible alternatives

No response

Additional information

Is there a reason for the current separation?

@arcs- arcs- added the enhancement New feature or request label May 30, 2024
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

1 participant