Open productdevbook opened 2 years ago
GraphQL Codegen isn't currently supported nor is it planned as yet.
Would the maintainers accept a PR that implements codegen? Would be amazing if a graphql/
folder was read and composables were auto-imported for each query in the files in that folder.
i.e.:
# ~/graphql/Users.graphql
query Me {
name
email
}
<script setup lang="ts">
// auto-imported
const { data, loading } = useUsersMeQuery()
</script>
@tkofh Ofcourse, PRs are welcomed for review.
any update?
Using the new client-preset
recommended by GraphQL Code Generator, I was able to generate type defs without having to create a new code generator.
Here is a minimum example: https://github.com/resessh/nuxt3-apollo-example
@resessh followed your guide, works partially on my case. TypeScript keeps screaming at me because gql.ts
has explicit any
and I can't disable that check. :(
It also complains about duplicate types being generated if I enable TypeScript plugin.
https://www.the-guild.dev/graphql/codegen/plugins/typescript/typescript-vue-apollo
This support would be great. It is easier to write as Ts.