Replies: 1 comment
-
had a look in the implementation where the index.ts generation is, the relevant code seems to be this https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/client/src/index.ts#L291 , basically |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I set up client-preset according to instructions here https://the-guild.dev/graphql/codegen/docs/guides/react-vue
In my app I need to pass graphql query results to react components in other modules, which leads to situations where I need to explicitly provide the type. I initially wrote type interfaces until I realized I am writing a lot of boilerplate, and why don't I just directly use the generated graphql types. I found that these types are defined in
graphql.ts
, but somehow they are not being exported... onlygql.ts
andfragment-masking.ts
are:gql/index.ts:
(we can also find examples of this in the official examples directory, e.g. https://github.com/dotansimha/graphql-code-generator/blob/master/examples/react/apollo-client/src/gql/index.ts)
i would like to know if there is any reason why? any disadvantages to using the stuff inside graphql.ts outside of /gql?
btw, even if i add
export * from './graphql'
manually, it will just get overwritten in the next codegen run.thanks!
Beta Was this translation helpful? Give feedback.
All reactions