Selection#toString currently returns the string representation of selectionSet which is weird for anything other than query.
I was using it with graphql-ws, passing the outcome of toString() to subscribe, which worked for queries, but started failing for mutations because in absense of operation type server defaults to Query type.
I propose that toString basically be the string analogue of toQuery.
This is a breaking change in behavior, but I don't think many people would be using toString for mutations/subscriptions etc. as the current output would need some postprocessing before it can be used.
Selection#toString
currently returns the string representation of selectionSet which is weird for anything other than query.I was using it with graphql-ws, passing the outcome of toString() to subscribe, which worked for queries, but started failing for mutations because in absense of operation type server defaults to Query type.
I propose that
toString
basically be the string analogue oftoQuery
.This is a breaking change in behavior, but I don't think many people would be using toString for mutations/subscriptions etc. as the current output would need some postprocessing before it can be used.