Repository navigation
v0.1.0
uses: github.com/linyows/probe-graphql@f9e7b841b87dccbcbe71ae10f8562aa637d52a51 # v0.1.0Highlights
- The first release: a Probe action that sends a GraphQL query or mutation over HTTP, and returns the
dataanderrorsof the response apart. - It is an external action, the first one, for Probe v1.17.0 or later.
- The repository has since moved to mozership/probe-graphql. v0.1.1 is the same action, released from there.
Sending a query
- name: Look up Japan
uses: github.com/linyows/probe-graphql@f9e7b841b87dccbcbe71ae10f8562aa637d52a51 # v0.1.0
with:
url: https://countries.trevorblades.com/graphql
query: |
query Country($code: ID!) {
country(code: $code) { name capital currency }
}
variables:
code: JP
test: res.code == 200 && len(res.errors) == 0 && res.data.country.capital == "Tokyo"withtakesurl,query,variables,operation_name,headersandtimeout(default30s). The request is aPOSTwith a JSON body.res.dataandres.errorshold thedataanderrorsof the response, andres.bodythe whole body.statusis0when the status code is 2xx, the body is JSON anderrorsis empty.- Any response the server sends is a result, so a test can assert on a GraphQL error or a 500. Only a request that gets no response fails the step as an error.
- The action keeps to no guard: under
--read-onlyor--allow-host, a step that uses it is refused unless--allow-actionnames it.
Releasing
A v* tag builds the executables with GoReleaser, and the release workflow commits an action.yml with their URLs and SHA-256 digests. That commit, in the uses line above, is the one to pin.
Changelog
- 7edaf9e Send a GraphQL query from a Probe workflow