-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Make mergeAST
opt-in only
#836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The original PR, this is a fairly recent feature: Stumbled across this while trying to convert GraphiQL to typescript! |
This has turned out to be a much more complicated undertaking than the original scope of this utility, to be feature perfect for all the edge cases of it's original purpose. @IvanGoncharov has provided a lot of insight on this. This current implementation does not take into account aliases, directives, etc. I worry that the "Merge Query" button as it stands, in the current latest release of GraphiQL, could erase part of a user's query. My PR above is a starting point, but I'll need more time to research things more fully and not waste the |
💯 It would be unfair to remove it entirely; let people opt in if they're aware of the issues. In v1.0 this will be a plugin (quite likely a non-default one, I think we should keep our default set of buttons to a minimum). |
agreed, I think its a powerful feature, but best left disabled by default, given the unintended consequences. that said, I think it's very powerful for projects with complex use of fragments, such as complex gatsby projects, or other large scale graphql schemas |
Yeah, it’s great for pinning down issues in large queries as you can do proper bisection which is hard with fragments. |
mergeAst
to not mutate AST directlymergeAST
opt-in only
As per discussions with @IvanGoncharov, the
utility/mergeAst
function looks like a good candidate for inclusion ingraphql-js
itself, however it shouldn't be mutating AST directly. Instead, we will refactor it to use thevisit
function to accomplish this, and then open a PR tographql-js
. This is just a placeholder for the forthcoming PRThe text was updated successfully, but these errors were encountered: