Generate general type file #144
-
Hey, thanks for the great project. I am currently moving over from client-preset and until now it works really great. There is one question, which i was unable to find an answer to: Is there a way to generate types from our graphql schema that can be used in other places of our code? Or is/will this not be the responsibility of this library? In client-preset you could import the types you needed (for example enums) and use them normally in your code (i.e. without any query/mutation). <div class="row">
<custom-select
v-model="addition.type"
:options="Object.values(AdditionType)"
label="Type"
class="col input-required"
/>
</div>
<script setup>
import { AdditionType } from '@/graphql/generated/graphql'
...
</script>
I assume one option would be to use the graphql-codegen project and instead use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
You can still import scalar, enum, and input types with the |
Beta Was this translation helpful? Give feedback.
You can still import scalar, enum, and input types with the
graphql.scalar
helper https://gql-tada.0no.co/reference/gql-tada-api#graphql-scalar for full-types we encourage folks to use fragment co-location.