nuxt-graphql-client
nuxt-graphql-client copied to clipboard
Auto-Import all Types of Queries and Fragments
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?