-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use graphql-js's types as a library #486
Comments
I don't see why this would be the case - does a monorepo necessarily restrict the dependencies of the subdirectory? Also, express-graphql and graphql don't overlap at all as far as I know. |
This is the issue I was reading to find out more about the error I was getting. graphql/graphiql#58 They overlap in some sense: https://github.com/graphql/express-graphql/blob/bdd7a954aff7621bb338d722b44371f7643c2258/src/index.js#L12:L20 I will try to whip up an example repo. |
We've tried to set up the dependencies such that npm will install in a flattened way. Of course, this is notoriously challenging thanks to npm so YMMV. For example, with express-graphql, this peer-dependency is intentionally extremely loose https://github.com/graphql/express-graphql/blob/master/package.json#L98 |
The @leebyron But still what about the original question, are there reasons we cannot split the |
Problem is that "types" part also use some of "runtime" parts so instead of solving issues it will likely introduce the new ones. IMHO, the multipackage setup works for projects with a loose coupling like core and "plugins", e.g. Babel. I'm closing this issue since we released a first stable version( |
I know there is a current limitation where two instances of Graphql cannot be in your app, however, I have created http://npm.im/gra which wraps the graphql types to be shorter. The problem is that in a monorepo setup using lerna or something similar, I cannot have one npm package which uses express-graphql and a separate one for the schema which relies upon graphql. Would it be possible to publish the graphql types in their own repo so that they can be relied upon without the restriction or is the coupling pretty tight? It would just be nice to be able to use graphql-js's types as a library.
Thanks!
The text was updated successfully, but these errors were encountered: