Skip to content

Instantly share code, notes, and snippets.

@mshick
Last active July 19, 2024 19:06
Show Gist options
  • Save mshick/5510c7a045881df5c6d55e527b745458 to your computer and use it in GitHub Desktop.
Save mshick/5510c7a045881df5c6d55e527b745458 to your computer and use it in GitHub Desktop.
curl, api testing
IS_OFFLINE='true' \
DYNAMO_DB_ENDPOINT='http://127.0.0.1:8000' \
ES_ENDPOINT='http://127.0.0.1:9200' \
SNS_ENDPOINT='http://127.0.0.1:4002' \
REDIS_ENDPOINT='redis://127.0.0.1:6379' \
TS_REGION='us-east-1' \
TS_ENV='dev' \
APP_BASE_URL='http://localhost:3001' \
API_BASE_URL='http://localhost:3000' \
CONFIGURATON_OVERRIDES_JSON='{"resources":{"topics":{"activity":{"topicArn":"arn:aws:sns:us-east-1:590044319366:offline-activity"}}}}' \
FUNCTION_FILE_PATH='./functions/graphqlUser/handler.js' \
pnpm start
curl http://localhost:4000/graphql -i \
--header "accept: application/graphql-response+json, application/json, multipart/mixed" \
--header "content-type: application/json" \
--no-buffer \
--data-raw \
'{"query":"query StreamStuff {\n  alphabet @stream {\n    letter\n  }\n  numbers @stream {\n    num\n  }\n}","operationName":"StreamStuff","extensions":{}}'
curl http://localhost:3000/project/840e9ad5-f11a-46c8-9f76-eb40b606bc2c/graphql -i \
-X POST \
--header "accept: application/graphql-response+json, application/json, multipart/mixed" \
--header "authorization: Bearer pat_59464f2a32524025b5ff2d080314d165" \
--header "content-type: application/json" \
--no-buffer \
--data-raw \
'{"query":"{\n getStream\n}","variables":{}}'
curl http://localhost:8080/project/840e9ad5-f11a-46c8-9f76-eb40b606bc2c/graphql -i \
-X POST \
--header "accept: application/graphql-response+json, application/json, multipart/mixed" \
--header "authorization: Bearer pat_59464f2a32524025b5ff2d080314d165" \
--header "content-type: application/json" \
--header "x-route-key: POST /project/{id}/graphql" \
--header "x-path: /project/840e9ad5-f11a-46c8-9f76-eb40b606bc2c/graphql" \
--no-buffer \
--data-raw \
'{"query":"{\n getStream @stream \n}","variables":{}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment