34 lines
810 B
Bash
Executable File
34 lines
810 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# MUTATION: Mark message as read
|
|
# SAFETY: Safe - idempotent operation, only changes read status
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <message_id>"
|
|
echo ""
|
|
echo "Example: $0 123"
|
|
echo ""
|
|
echo "This mutation marks a message as read."
|
|
echo "Safe to run multiple times (idempotent)."
|
|
echo ""
|
|
echo "Note: Requires a valid message ID from production."
|
|
exit 1
|
|
fi
|
|
|
|
MESSAGE_ID=$1
|
|
|
|
source "$(dirname "$0")/../apikey"
|
|
source "$(dirname "$0")/../apiendpoint"
|
|
|
|
curl -X POST "$GRAPHQL_ENDPOINT" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
--data-binary @- <<EOF | jq
|
|
{
|
|
"query": "mutation MarkMessageAsRead(\$id: Int!) { markMessageAsRead(id: \$id) { id subject read createdAt } }",
|
|
"variables": {
|
|
"id": $MESSAGE_ID
|
|
}
|
|
}
|
|
EOF
|