apollographql / graphql-tag

A JavaScript template literal tag that parses GraphQL queries
MIT License
2.32k stars 176 forks source link

graphql-tag 3 that removes arbitrary string interpolation #748

Open benasher44 opened 1 year ago

benasher44 commented 1 year ago

Hello! I see there is a comment to remove the ability to do arbitrary string interpolation in graphql-tag. I think the ecosystem has matured enough such that interpolating variables is no longer necessary (in most libraries, the ability to pass variables is readily available at the usage/call site). We have patched graphql-tag locally to remove the ability to do arbitrary string interpolation, which has been really helpful to force us to do the < 2 min of extra work to send a variables dict. It would be really great to remove this and publish a graphql-tag v3, creating safer graphql-tag usage.

I'd be happy to open the PR, but I wanted to open an issue first, since this would be a significant breaking change.