GraphQL, WebSocket & gRPC
New Request… offers the HTTP methods plus three other kinds of request: WebSocket,
gRPC and GraphQL. They’re ordinary .bru files, so they use the active environment
and inherit headers and auth from their folder and collection like any HTTP request.
GraphQL
Section titled “GraphQL”GraphQL requests have a query editor and a variables editor. Queries and mutations send over HTTP like any other request.
Subscriptions open a live connection instead. Vegha speaks both the
graphql-transport-ws and the older graphql-ws protocol. Press Subscribe
(Ctrl+Enter) and events stream into the message log until you Disconnect.
WebSocket
Section titled “WebSocket”Press Connect to open the connection. The editor then shows:
- a live message log, which you can filter, expand to pretty-printed JSON, and copy from;
- a composer for sending messages;
- Disconnect to close the connection.
Vegha reads the service definition from the server using server reflection, so you
don’t need .proto files.
- Enter the server address and pick a method from the method picker.
- A new message starts as a skeleton of the method’s input type, written as JSON.
- Press Invoke (
Ctrl+Enter).
All four call shapes work: unary, server streaming, client streaming and bidirectional streaming. For client and bidirectional streams, send messages from the composer and use End stream when you’re done.
If the server doesn’t expose reflection, Vegha tells you that no services were reported.
Enable reflection on the server (for example Grpc.AspNetCore.Server.Reflection in .NET) to
call it from Vegha.
SOAP services are plain HTTP POST requests with an XML body. Import a WSDL or SoapUI project to generate them. See Import & export.