question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple fragments per file

See original GitHub issue

Hello, thanks for a great package first of all!

I just found out that it doesn’t support multiple fragments import. Is it possible to fix it? From the source code, I see that the only reason is this line: https://github.com/detrohutt/babel-plugin-inline-import-graphql-ast/blob/master/plugin/multi-op.js#L19 If we would remove this check - it might do the trick. Unfortunately, as far as I can see, it will break backward compatibility in a sense if you have a fragment and an operation defined in a single file, the first operation should be returned as a default import. So we need also to change the default document determination algorithm to set up precedence of operations over fragments despite the ordering. Am I right?

Also, one minor thingy noted - would be nice to support an optional space between # and import. It was really tough to figure out why doesn’t it work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
pyromaniaccommented, May 18, 2018

It works just awesomely! Thanks again!

1reaction
detrohuttcommented, May 18, 2018

Ah, you did mention all of that in the description. Sorry, it’s been a busy last few days. Depending on how much trouble I run into with v3.0.0, I may continue messing with it on the master branch. I was headed in the direction you mentioned, checking for files with only fragments, etc but it was adding more code than I wanted to and seemed a little overly complex/verbose (coding while tired) but I can probably clean it up when I’m not tired. Anyway, thanks for your patience and I’ll keep you updated on what I get going.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NTFS Limitations -- max fragments per file - Super User
@ryansin "When a file is very fragmented, NTFS uses more space to save the description of the allocations that is associated with the...
Read more >
File system fragmentation - Wikipedia
In computing, file system fragmentation, sometimes called file system aging, is the tendency of a file system to lay out the contents of...
Read more >
Android: Multiple Fragments from same XML file
The fragments in the view pager are all created from the same XML file. These fragments then have fragments added inside of them....
Read more >
Understanding the Fragmentation Analysis
In this example, the fragments per file ratio is 1.58, indicating that about 58 percent of files are fragmented into two or more...
Read more >
Fragments File -Software -Single Cell Multiome ... - Support
Each fragment is created by two separate transposition events, which create the two ends of the observed fragment. Each unique fragment may generate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found