25 lines
606 B
Bash
Executable File
25 lines
606 B
Bash
Executable File
#!/bin/bash
|
|
# Query: queryBooleanAdder - Boolean query helper
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <query_string>"
|
|
echo "Example: $0 'test query'"
|
|
exit 1
|
|
fi
|
|
|
|
QUERY_STRING="$1"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/../apikey"
|
|
|
|
curl -s -X POST "https://graphql.ordrestyring.dk/graphql" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer ${API_KEY}" \
|
|
--data-binary @- <<EOF | jq '.'
|
|
{
|
|
"query": "query QueryBooleanAdder(\$query: String!) { queryBooleanAdder(query: \$query) }",
|
|
"variables": {
|
|
"query": "${QUERY_STRING}"
|
|
}
|
|
}
|
|
EOF
|