diff options
author | Drew DeVault <sir@cmpwn.com> | 2021-01-25 11:04:22 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2021-01-25 11:04:22 -0500 |
commit | eaf07004e440b78c5b81723cffec2933635f750b (patch) | |
tree | 0f3b515c8ecee645adf0b53f585a7d3ef4e89147 | |
parent | 3fbfacabfffa430639f1d017b5bfd1210387dc1f (diff) | |
download | sr.ht-docs-eaf07004e440b78c5b81723cffec2933635f750b.tar.gz |
Add explanation of what's going on in README command
-rw-r--r-- | git.sr.ht/index.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/git.sr.ht/index.md b/git.sr.ht/index.md index 2a1a662..f072ee6 100644 --- a/git.sr.ht/index.md +++ b/git.sr.ht/index.md @@ -147,6 +147,32 @@ jq -R '{ -d@- https://git.sr.ht/query ``` +This looks a bit complicated, so to explain what's happening here: we want to +execute the following GraphQL request: + +``` +mutation UpdateRepo($id: Int!, $readme: String!) { + updateRepository(id: 60, input: { readme: $readme }) { id } +} +``` + +The [jq](https://stedolan.github.io/jq) command takes the input (your README +file) and incorporates it into a JSON string with the following format: + +``` +{ + "query": "the desired GraphQL query...", + "variables": { + "id": 1337, + "readme": "your README HTML..." + } +} +``` + +This is [the input](https://man.sr.ht/graphql.md#performing-graphql-queries) to +the git.sr.ht GraphQL endpoint at `git.sr.ht/graphql`, which is piped from jq +into [curl](https://curl.se) to send the request to git.sr.ht. + It may be desirable to configure a builds.sr.ht job to compile your README from another markup format and submit it on each git push. If so, you will need to review the [build secrets tutorial][secrets] to safely store your OAuth token. |