Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is quite the rewrite and I'm fully aware it may not be well received. I was about to create something along the lines of nanographql before I knew it even existed. But as I started looking into parsing GraphQL queries with RegExp I realized we can do much more than just deriving the operation name. This did however bring a significant increase in size, from 15 LOC to ~200, so it may not be legitimately "nano" anymore.
Since I'm not currently a user of nanographql I'd really appreciate some feedback from people using it. If the changes are not welcome I'll just publish it under a different name. Alternately, the cache and fetching bits could be split out to another package, e.g.
choo-graphql
or something. However, these changes do address all issues and PRs currently open in this project.These changes address:
toString
,toJSON
) and even iterate over its properties (variables must be a object #7)no-var
rule in a major updateSee README for complete documentation of new functionality.