24
24
--header 'content-type: application/json' \
25
25
--header 'X-API-Key: ${{ secrets.APOLLO_USER_KEY }}' \
26
26
--url 'https://graphql.api.apollographql.com/api/graphql' \
27
- --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $description: String, $linkedVariants: [String!]) {\n graph(id: $graphId) {\n createPersistedQueryList(name: $name, description: $description, linkedVariants: $linkedVariants) {\n ... on CreatePersistedQueryListResult {\n persistedQueryList {\n id\n createdAt\n }\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.workshopID }}${{ env.GEN }}","name":"pq_list","description":"Our PQ List","linkedVariants":["current"]}}' -o pq.json
27
+ --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $description: String, $linkedVariants: [String!]) {\n graph(id: $graphId) {\n createPersistedQueryList(name: $name, description: $description, linkedVariants: $linkedVariants) {\n ... on CreatePersistedQueryListResult {\n persistedQueryList {\n id\n createdAt\n }\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.WORKSHOPID }}${{ env.GEN }}","name":"pq_list","description":"Our PQ List","linkedVariants":["current"]}}' -o pq.json
28
28
cat pq.json
29
29
30
30
- name : Set Env
40
40
41
41
- name : Publish PQ List
42
42
run : |
43
- rover persisted-queries publish --graph-id ${{vars.ACTOR}}-${{vars.workshopID }}${{env.GEN}} --list-id ${{env.PQ_ID}} \
43
+ rover persisted-queries publish --graph-id ${{vars.ACTOR}}-${{vars.WORKSHOPID }}${{env.GEN}} --list-id ${{env.PQ_ID}} \
44
44
--manifest ./final/workshop-pq-manifest.json
45
45
46
46
deploy :
@@ -58,19 +58,19 @@ jobs:
58
58
credentials_json : ${{ secrets.GCP_CREDENTIALS }}
59
59
- name : Get URL
60
60
run : |
61
- gcloud run services describe ${{vars.ACTOR}}-${{vars.workshopID }}-router --region us-central1 --format 'value(status.url)' > url.json
61
+ gcloud run services describe ${{vars.ACTOR}}-${{vars.WORKSHOPID }}-router --region us-central1 --format 'value(status.url)' > url.json
62
62
echo "URL=$(cat url.json)" >> $GITHUB_ENV
63
63
- name : Set URL
64
64
run : |
65
65
curl --request POST \
66
66
--header 'content-type: application/json' \
67
67
--header 'X-API-Key: ${{ secrets.APOLLO_USER_KEY }}' \
68
68
--url 'https://graphql.api.apollographql.com/api/graphql' \
69
- --data '{"query":"mutation UpdateURL($name: String!, $graphId: ID!, $url: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateURL(url: $url) {\n createdAt\n }\n }\n }\n}","variables":{"name":"current","graphId":"${{vars.ACTOR}}-${{vars.workshopID }}${{ env.GEN }}","url":"${{ env.URL }}"}}'
69
+ --data '{"query":"mutation UpdateURL($name: String!, $graphId: ID!, $url: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateURL(url: $url) {\n createdAt\n }\n }\n }\n}","variables":{"name":"current","graphId":"${{vars.ACTOR}}-${{vars.WORKSHOPID }}${{ env.GEN }}","url":"${{ env.URL }}"}}'
70
70
71
71
- name : Get Contract Router URL
72
72
run : |
73
- gcloud run services describe ${{vars.ACTOR}}-${{vars.workshopID }}-contractRouter --region us-central1 --format 'value(status.url)' > contractURL.json
73
+ gcloud run services describe ${{vars.ACTOR}}-${{vars.WORKSHOPID }}-contractRouter --region us-central1 --format 'value(status.url)' > contractURL.json
74
74
echo "contractURL=$(cat contractURL.json)" >> $GITHUB_ENV
75
75
76
76
- name : Set URL
79
79
--header 'content-type: application/json' \
80
80
--header 'X-API-Key: ${{ secrets.APOLLO_USER_KEY }}' \
81
81
--url 'https://graphql.api.apollographql.com/api/graphql' \
82
- --data '{"query":"mutation UpdateURL($name: String!, $graphId: ID!, $url: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateURL(url: $url) {\n createdAt\n }\n }\n }\n}","variables":{"name":"public","graphId":"${{vars.ACTOR}}-${{vars.workshopID }}${{ env.GEN }}","url":"${{ env.URL }}"}}'
82
+ --data '{"query":"mutation UpdateURL($name: String!, $graphId: ID!, $url: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateURL(url: $url) {\n createdAt\n }\n }\n }\n}","variables":{"name":"public","graphId":"${{vars.ACTOR}}-${{vars.WORKSHOPID }}${{ env.GEN }}","url":"${{ env.URL }}"}}'
83
83
84
84
85
85
- name : Set Subscription URL
88
88
--header 'content-type: application/json' \
89
89
--header 'X-API-Key: ${{ secrets.APOLLO_USER_KEY }}' \
90
90
--url 'https://graphql.api.apollographql.com/api/graphql' \
91
- --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $subscriptionUrl: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateSubscriptionURL(subscriptionUrl: $subscriptionUrl) {\n createdAt\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.workshopID }}${{ env.GEN }}","name":"current","subscriptionUrl":"${{ env.URL }}"}}'
91
+ --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $subscriptionUrl: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updateSubscriptionURL(subscriptionUrl: $subscriptionUrl) {\n createdAt\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.WORKSHOPID }}${{ env.GEN }}","name":"current","subscriptionUrl":"${{ env.URL }}"}}'
92
92
93
93
preflightScript :
94
94
needs : publish
@@ -100,4 +100,4 @@ jobs:
100
100
--header 'content-type: application/json' \
101
101
--header 'X-API-Key: ${{ secrets.APOLLO_USER_KEY }}' \
102
102
--url 'https://graphql.api.apollographql.com/api/graphql' \
103
- --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $preflightScript: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updatePreflightScript(preflightScript: $preflightScript) {\n createdAt\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.workshopID}}${{ env.GEN }}","name":"current","preflightScript":"const API_KEY=\"AIzaSyBGEWuarfRs4vVIzbdPj7EU_h3tMAVO_e4\";console.log(\"fetching new token.....\");const getToken=async e=>{let o=await explorer.fetch(\"https:\/\/identitytoolkit.googleapis.com\/v1\/accounts:signInWithPassword?key=AIzaSyBGEWuarfRs4vVIzbdPj7EU_h3tMAVO_e4\",{method:\"POST\",header:{\"Content-Type\":\"application\/json\"},body:JSON.stringify({email:e,password:\"apolloworkshop\",returnSecureToken:!0})});return o.json()},authorizedCredentials=await getToken(\"[email protected] \"),{idToken:authorizedToken}=authorizedCredentials;explorer.environment.set(\"authorizedToken\",authorizedToken),console.log(\"successfully set authorized token\");const unauthorizedCredentials=await getToken(\"[email protected] \"),{idToken:unauthorizedToken}=unauthorizedCredentials;explorer.environment.set(\"unauthorizedToken\",unauthorizedToken),console.log(\"successfully set token unauthorized token\");"}}'
103
+ --data '{"query":"mutation Mutation($graphId: ID!, $name: String!, $preflightScript: String) {\n graph(id: $graphId) {\n variant(name: $name) {\n updatePreflightScript(preflightScript: $preflightScript) {\n createdAt\n }\n }\n }\n}","variables":{"graphId":"${{vars.ACTOR}}-${{vars.WORKSHOPID}}${{ env.GEN }}","name":"current","preflightScript":"const API_KEY=\"AIzaSyBGEWuarfRs4vVIzbdPj7EU_h3tMAVO_e4\";console.log(\"fetching new token.....\");const getToken=async e=>{let o=await explorer.fetch(\"https:\/\/identitytoolkit.googleapis.com\/v1\/accounts:signInWithPassword?key=AIzaSyBGEWuarfRs4vVIzbdPj7EU_h3tMAVO_e4\",{method:\"POST\",header:{\"Content-Type\":\"application\/json\"},body:JSON.stringify({email:e,password:\"apolloworkshop\",returnSecureToken:!0})});return o.json()},authorizedCredentials=await getToken(\"[email protected] \"),{idToken:authorizedToken}=authorizedCredentials;explorer.environment.set(\"authorizedToken\",authorizedToken),console.log(\"successfully set authorized token\");const unauthorizedCredentials=await getToken(\"[email protected] \"),{idToken:unauthorizedToken}=unauthorizedCredentials;explorer.environment.set(\"unauthorizedToken\",unauthorizedToken),console.log(\"successfully set token unauthorized token\");"}}'
0 commit comments