relay icon indicating copy to clipboard operation
relay copied to clipboard

Add copy operation command

Open tobias-tengler opened this issue 5 months ago • 3 comments

I often find myself in a situation where I want to quickly run a Relay query outside of the configured Relay environment, i.e. a GraphQL IDE or another tool. When not using persisted operations, I need to go to the artifact, copy out the value of the text property and get rid of all the \n line breaks in the text. For persisted operations it's less tedious, I just grab the id from the artifact and look up the operation in the operation store, but it's still more cumbersome than it has to be.

This implements a new relay/printOperation request in the LSP that returns the transformed operation text of the operation under the cursor or the first operation inside the document. The VS Code Extension is also updated with a relay.copyOperation command that invokes that LSP request and copies the operation text to the clipboard.

Example of the command in action

tobias-tengler avatar Aug 29 '24 17:08 tobias-tengler