evenchange4 / graphql.macro

Compile GraphQL AST at build-time with babel-plugin-macros.
MIT License
239 stars 21 forks source link

fix: remove duplicate fragments (fix #90) #94

Closed FezVrasta closed 5 years ago

FezVrasta commented 5 years ago

With this PR, we deduplicate fragments at runtime.

I wanted to do this at build time inside Babel but I can't find a way to do it ☹️

I copied the approach from babel-plugin-graphql-tag

codecov[bot] commented 5 years ago

Codecov Report

Merging #94 into master will increase coverage by 0.08%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   95.83%   95.91%   +0.08%     
==========================================
  Files           5        5              
  Lines          48       49       +1     
  Branches        8        8              
==========================================
+ Hits           46       47       +1     
  Misses          2        2
Impacted Files Coverage Δ
src/utils/compileWithFragment.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87c5b9b...acca2a7. Read the comment docs.

evenchange4 commented 5 years ago

Accept the PR for now. I have not come up with a better solution to reduce runtime, either.