Graphql-tag: Stop bundling GraphQL js

Created on 7 Jul 2016  路  15Comments  路  Source: apollographql/graphql-tag

Now that the bundling errors have been fixed we should remove the bundled code from this repo again and test that it still works in react native.

Most helpful comment

Sorry totally forgot about this issue. Let me put it on my schedule for today

All 15 comments

Do we still wanna do this?

This is more critical now, because parsing actually changed in 0.8.x to support null as a literal. If you have the time to do this that would be great!

Yeah I can def take a look.

A couple concerns are people who used print/parser from gql tag who will now be broken.

So we will need to plan accordingly.

Another idea is to bundle the newer versions of those libs and bundle with webpack2.

@abhiaiyer91 oh, I was just thinking this could have a dependency (or peer dep) on graphql and re-export from graphql-tag/print and graphql-tag/parse like before?

Nice yeah I'll def do that.

Issues I'm running into right now is how the parse function has changed. We're getting caught in Max call stacks in tests when we stripLoc.

Diving into that will let you know

how the parse function has changed

I seem to recall something has changed about the loc thing but I can't remember what...

Any update @abhiaiyer91 ?

ping @abhiaiyer91, any updates here?

Sorry totally forgot about this issue. Let me put it on my schedule for today

We actually had to make some changes to graphql-js recently to make it support Rollup for the Angular integration. So now it should be possible for people to do dead code elimination when using this package, if we remove our own custom bundling!

Alright so we definitely have an issue stripping the loc field from the AST generated by the graphql parser. The issue here is in the stripLoc function. As we traverse down the AST deleting loc, we hit a maximum call stack error.

Quick question, why do we stripLoc? Just wondering?

We do that because if you serialize the query to JSON then we end up with a ton of copies of the query string. Maybe the ast structure changed in a newer version?

I had the same problem with stripLoc. I wrote the problem and a solution in #44

https://github.com/apollographql/graphql-tag/pull/46

@KordonDev nice! I realized the same about the new AST structure last night!

This is done, but not released.

Was this page helpful?
0 / 5 - 0 ratings