Skip to content

Commit

Permalink
Show GraphQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
sindrig committed Aug 18, 2021
1 parent b063227 commit 9f9910f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion presentation/5.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ read -r

env=${1:-prod}

query='mutation {\n submitApplication(\n application: {\n nationalId: \"0101302989\"\n children: [{nationalId: \"1502143190\"}]\n preferredJobs: [{ name: \"developer\" }, { name: \"manager\" }]\n startDate: \"2021-10-01\"\n }\n ) {\n id\n }\n}\n'
printf "$query"
created_application=$(curl -s 'https://'"$env"'.islandis.island.andes.cloud/graphql' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Connection: keep-alive' \
-H 'DNT: 1' \
-H 'Origin: https://'"$env"'.islandis.island.andes.cloud' \
--data-binary '{"query":"mutation {\n submitApplication(\n application: {\n nationalId: \"0101302989\"\n children: [{nationalId: \"1502143190\"}]\n preferredJobs: [{ name: \"developer\" }, { name: \"manager\" }]\n startDate: \"2021-10-01\"\n }\n ) {\n id\n }\n}\n"}' \
--data-binary '{"query":"'"$query"'"}' \
--compressed
)

Expand Down
4 changes: 3 additions & 1 deletion presentation/5.2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ read -r

env=${1:-prod}

query='mutation {\n submitApplication(\n application: {\n nationalId: \"0000000000\"\n children: [{nationalId: \"1502143190\"}]\n preferredJobs: [{ name: \"developer\" }, { name: \"manager\" }]\n startDate: \"2021-10-01\"\n }\n ) {\n id\n }\n}\n'
printf "$query"
curl -s 'https://'"$env"'.islandis.island.andes.cloud/graphql' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Connection: keep-alive' \
-H 'DNT: 1' \
-H 'Origin: https://'"$env"'.islandis.island.andes.cloud' \
--data-binary '{"query":"mutation {\n submitApplication(\n application: {\n nationalId: \"0000000000\"\n children: [{nationalId: \"1502143190\"}]\n preferredJobs: [{ name: \"developer\" }, { name: \"manager\" }]\n startDate: \"2021-10-01\"\n }\n ) {\n id\n }\n}\n"}' \
--data-binary '{"query":"'"$query"'"}' \
--compressed | jq

0 comments on commit 9f9910f

Please sign in to comment.