relay
relay copied to clipboard
Add copy operation command
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.