You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a monorepo typescript/nextjs/apollo project with two main app packages and a third "shared" package for common components. I would like to extract basic schema types into a separate "types" file in the shared package so that they are not duplicated across packages, and then allow each individual package (including "shared") to define .graphql files with their own unique operations. I'm attempting to do this with the import-types preset like so:
This almost works except that the operation types generated by 'typescript-react-apollo' are incorrectly referenced as though they are defined in types.ts, even though they are (correctly) defined in the main api file.
Can anybody think of a workaround for this, or a way to make a custom plugin that fixes the problem? I've been playing around with the plugin API, but it seems like there isn't a good way to modify the output of previous plugins/presets, unless i'm missing something. Help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a monorepo typescript/nextjs/apollo project with two main app packages and a third "shared" package for common components. I would like to extract basic schema types into a separate "types" file in the shared package so that they are not duplicated across packages, and then allow each individual package (including "shared") to define .graphql files with their own unique operations. I'm attempting to do this with the import-types preset like so:
This almost works except that the operation types generated by 'typescript-react-apollo' are incorrectly referenced as though they are defined in types.ts, even though they are (correctly) defined in the main api file.
Can anybody think of a workaround for this, or a way to make a custom plugin that fixes the problem? I've been playing around with the plugin API, but it seems like there isn't a good way to modify the output of previous plugins/presets, unless i'm missing something. Help!
Beta Was this translation helpful? Give feedback.
All reactions