Update API test script
This commit is contained in:
parent
e6a287992a
commit
a2b60d3f58
@ -19,5 +19,8 @@ abc=$(echo "$chatIDs" | jq -r .aGroupChats[0].id)
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo Send a private/group message:
|
echo Send a private/group message:
|
||||||
#echo "{\"pwHash\":\"1234567890\",\"a\":\"$a\",\"bChat\":\"$ab\",\"abc\":\"$abc\",\"msg\":{\"msgType\":\"TEXT\",\"content\":\"Test\"}}" | jq .
|
|
||||||
curl "localhost:8080/graphql" -X POST -H "content-type: application/json" --data "{\"query\":\"mutation sendMessages(\$a: ID!, \$pwHash: String!, \$bChat: ID!, \$abc: ID!, \$msg: MessageInput!) {\n chat: sendMessage(user: \$a, passwordHash: \$pwHash, chat: \$bChat, msg: \$msg)\n group: sendMessage(user: \$a, passwordHash: \$pwHash, chat: \$abc, msg: \$msg)\n}\",\"variables\":{\"pwHash\":\"1234567890\",\"a\":\"$a\",\"bChat\":\"$ab\",\"abc\":\"$abc\",\"msg\":{\"msgType\":\"TEXT\",\"content\":\"Test\"}},\"operationName\":\"sendMessages\"}" | jq .
|
curl "localhost:8080/graphql" -X POST -H "content-type: application/json" --data "{\"query\":\"mutation sendMessages(\$a: ID!, \$pwHash: String!, \$bChat: ID!, \$abc: ID!, \$msg: MessageInput!) {\n chat: sendMessage(user: \$a, passwordHash: \$pwHash, chat: \$bChat, msg: \$msg)\n group: sendMessage(user: \$a, passwordHash: \$pwHash, chat: \$abc, msg: \$msg)\n}\",\"variables\":{\"pwHash\":\"1234567890\",\"a\":\"$a\",\"bChat\":\"$ab\",\"abc\":\"$abc\",\"msg\":{\"msgType\":\"TEXT\",\"content\":\"Test\"}},\"operationName\":\"sendMessages\"}" | jq .
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo Get private/group messages:
|
||||||
|
curl "localhost:8080/graphql" -X POST -H "content-type: application/json" --data "{\"query\":\"query getMessages(\$a: ID!, \$pwHash: String!, \$chat: ID!, \$groupChat: ID!) {\n chat: getMessages(user: \$a, passwordHash: \$pwHash, chat: \$chat) {\n id\n timestamp\n sender\n msgType\n content\n hideFor\n seenBy\n }\n groupChat: getMessages(user: \$a, passwordHash: \$pwHash, chat: \$groupChat) {\n id\n timestamp\n sender\n msgType\n content\n hideFor\n seenBy\n }\n}\",\"variables\":{\"a\":\"$a\",\"pwHash\":\"1234567890\",\"chat\":\"$ab\",\"groupChat\":\"$abc\"},\"operationName\":\"getMessages\"}" | jq .data
|
Loading…
Reference in New Issue
Block a user