Repository navigation
Releases: mozership/probe-graphql
Release list
v0.2.0
uses: github.com/mozership/probe-graphql@41e4ffa222db58c63c7169117c919e6d252bdbf9 # v0.2.0Highlights
- The action now keeps to the guard of a run, and its
action.ymldeclaresguard: [read-only, allow-host], so Probe v1.21.0 or later runs it under--read-onlyand--allow-hostwithout--allow-action. - Its
action.ymldeclaresparams, soprobe checkreports a key ofwiththe action does not take. - A key of
withthe action does not take now fails the step.
Keeping to the guard
The action used to keep to no guard, so a step that used it was refused under --read-only or --allow-host unless --allow-action named it. It now refuses, before anything is sent, what the guard does not allow, and the step fails with the kind refused:
- Under
--read-only, only a query is sent. The operation to run, the oneoperation_namenames or the only one in the document, is read with gqlparser. A mutation or a subscription is refused, and so is a document that does not parse, one with several operations and nooperation_name, and anoperation_namethe document does not have. - Under
--allow-host, the host ofurl, and of each redirect, must be one the run allows. A URL without a port is taken at the port of its scheme.
Parameters
params: [url, query, variables, operation_name, headers, timeout] in action.yml lets probe check report a misspelled key with its line. The action checks the same list itself, so a key that is not one of them fails the step before anything is sent; it used to be ignored.
Requirements
The action runs on Probe v1.17.0 or later as before. Running it under a guard, and having probe check check its with, need Probe v1.21.0 or later. See GraphQL.
Changelog
v0.1.1
uses: github.com/mozership/probe-graphql@ad456d1eefd30a63d14b49c730e5239c4749b34b # v0.1.1Highlights
- The same action as v0.1.0, released from mozership/probe-graphql, where the repository moved from linyows.
- Its
action.ymldownloads the executables from this repository's release, rather than through GitHub's redirect from linyows. - Nothing else changes: the same
with, the same result, Probe v1.17.0 or later.
The move to mozership
- The module path is now
github.com/mozership/probe-graphql, and the README, theusesform andscripts/action-yml.shname mozership. - A step pinned to v0.1.0 under
github.com/linyows/probe-graphqlstill resolves through GitHub's redirect. Pinning the commit above undergithub.com/mozership/probe-graphqlneeds no redirect at all.
See GraphQL.
Changelog
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