-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add copy operation command #4778
Add copy operation command #4778
Conversation
32ea7f5
to
f1262f3
Compare
Really nice! Did you consider making it a code action instead? |
At least for me the extension command seemed faster, as I don't first have to locate the operation inside the document if there's only one. |
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@captbaritone Had to update the minimum compiler version check to 18. |
1a039fd
to
45bc017
Compare
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@captbaritone merged this pull request in 8d2380b. |
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 theid
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 arelay.copyOperation
command that invokes that LSP request and copies the operation text to the clipboard.