Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended way of distributing SDK ? #554

Open
kyriediculous opened this issue Jul 11, 2023 · 0 comments
Open

Recommended way of distributing SDK ? #554

kyriediculous opened this issue Jul 11, 2023 · 0 comments

Comments

@kyriediculous
Copy link

kyriediculous commented Jul 11, 2023

Hi,

I'm trying to build the generated SDK as a separate package (in the future also adding resolvers, etc).

What is the recommended way of building and distributing the generated SDK ?

I've tried a few things so far but I'm hitting a couple of roadblocks.

E.g. when having "type": "module" in my package.json file and running graphclient build I get introspection errors when generating the schema Failed to generate the schema Error: Failed to fetch introspection from xxxxx: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

If I remove "type": "module" I can build the graphclient and compile the typescript, but when I then try to use the package in a separete codebase I get Module not found: Can't resolve '@graphql-mesh/utils' at runtime.

If I build as CJS using graphclient build --fileType js and import that in my other repo, I also get Can't resolve '@graphql-mesh/utils'

Any advice is much appreciated !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant