Graphql-yoga: Remove bundling from yoga?

Created on 13 Jan 2018  ·  10Comments  ·  Source: dotansimha/graphql-yoga

Currently, yoga supports schema bundling out of the box. This is nice, but it creates a lot of dependencies. And it feels a bit like Express running Webpack for you. It think there is a clear pattern emerging that you use graphql-cli and its config file to configure and run bundling on your schemas to process imports, and this task should no longer be included in yoga.

kindiscussion statustale

All 10 comments

At the risk of sounding pedantic, what is “schema bundling” in this instance?

Processing import statements (graphql-import)

Okay, this is what I assumed.

My hangup with extracting this functionality is doing that is contrary to the reason for the existence of graphql-yoga: 'with focus on easy setup'.

Requiring a developer to install any tools manually beyond graphql-yoga then makes the beauty of this project null and void. It seems graphql-yoga is being adopted by others because of it's 'Sensible defaults' and how it 'includes everything you need with minimal setup'.

If you are using graphql-yoga as a basic 'out of the box' graphql server, feeding it a schema and resolvers, you will not be needing schema imports, so to me, schema imports are not part of that 'focus on easy setup'.

As soon as you start working with bindings, you _are_ probably going to need schema imports. Now, as soon as you start using bindings, you are going to use graphql-cli with a config file to configure that. graphql-cli contains that bundling functionality as well.

Now of course you can use schema imports if you want to keep a very large schema organized in multiple files, but when you reach that level, you are already beyond the 'getting started experience'.

So even without built-in schema bundling support, I still believe graphql-yoga 'includes everything you need with minimal setup'. I think individual packages should focus on their core features, and try to include other things only when needed.

This is nice, but it creates a lot of dependencies.

graphql-import has two dependencies, graphql and lodash, neither of which are unique.

@wtgtybhertgeghgtwtg The dependency problem is actually the other way around. What I'm trying to minimize, is that whenever a new version of one of the ecosystem tools is published, that doesn't cause a release avalanche of new versions.

If you are using graphql-yoga as a basic 'out of the box' graphql server, feeding it a schema and resolvers, you will not be needing schema imports, so to me, schema imports are not part of that 'focus on easy setup'.

This is a broad statement and erroneous assumption of how an individual uses graphql-yoga. Schema imports can be applied at any size, not only large schemas.

As soon as you start working with bindings, you are probably going to need schema imports. Now, as soon as you start using bindings, you are going to use graphql-cli with a config file to configure that. graphql-cli contains that bundling functionality as well.

This isn't true, also. You can use bindings without needing graphql-cli.

I think individual packages should focus on their core features, and try to include other things only when needed.

This is a great sentiment to have except that it falls short in the use-case of an opinionated, easy to use/setup solution, i.e. graphql-yoga.

I believe that @wtgtybhertgeghgtwtg has a good point in that the behavior you are asking to be removed is only dependent on one package, which is dependent on two packages.

I'm trying to minimize [...] a release avalanche of new versions.

This is avoidable by not releasing a new version of graphql-yoga _every single time_ one of it's dependencies is updated.

tl;dr; - This whole ticket boils down to what we believe is the definition of a good 'out of the box' GraphQL server. In the end, graphql-yoga is an opinionated, minimal setup GraphQL server – not a GraphQL server with minimal features.

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Hey :wave:, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellomusodiq picture bellomusodiq  ·  3Comments

2wce picture 2wce  ·  4Comments

woss picture woss  ·  5Comments

SebastianEdwards picture SebastianEdwards  ·  4Comments

ahmedosama5200 picture ahmedosama5200  ·  4Comments