For example:
curl/queries_new_field.sh
curl https://www.universe.com/graphql/beta \
-H "Content-Type: application/json" \
-d @- << EOF
{
"query": "query GraphqlExample {
newField {
id
}
}"
}
EOF
# => {
# "data": {
# "newField": {
# "id": "123123123"
# }
# }
# }
README.md
## Contents
* [Queries](#queries)
* [New Field](#new-field)
## Queries
### New Field
<details name="curl/queries_new_field.sh"><summary><strong>cURL example</strong></summary>
</details>
Committing the changes will paste the source code to README automatically with pre-commit
and make generate
(idempotent).
Don't forget to set correct permissions to be able to execute the script:
$ chmod 755 ./curl/queries_new_field.sh
Add tests like:
result = `./curl/queries_new_field.sh`
expect(result).to eq(some_response)
Open a Pull Request with your changes.