Usage with npx
#9140
Replies: 1 comment
-
|
Hey @gimre, can you share a reproduction respository of your issue? Adding codegen and graphql as a dev dependency to the root workspace should just work fine |
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.
-
Hey, trying to use
grapql-code-generatorwith npx but not getting anywhere :(Context
Maintaining a npm workspaces repository with multiple packages and looking to migrate from apollo codegen to
grapql-code-generator. Previous setup didn't include apollo cli in any of the packages but expected developers to have it installed on their machine. Codegen would be defined and run at the package level like this ~Problem
While configuring
grapql-code-generatorI installed@graphql-codegen/cliand '@graphql-codegen/typescriptinside one of the packages that already hadgraphql` as a dependency and that ended up working fine.Trying to generalize for all packages, i tried switching to
but this results the unresolved peerDependency
graphql. Did not find a way to force npx to install graphql aswell before running the cli.Tried installing
graphql,@graphl-codegen/cliand@graphql-codegen/typescriptglobally and that will resolve thegraphqldependency issue but will break withI assume this is due to a resolution issue, since
codegen.tsis inside a workspace package and everything else is in npm cache.All this happens if i try to install packages at the root level aswell.
So...
Is there any way to either use the cli via npx or at least have it installed at the root level once instead of inside every workspace package?
Beta Was this translation helpful? Give feedback.
All reactions