Created
February 25, 2022 17:41
-
-
Save JayGreentree/a6f10453d5c0e1e8c7036f436fb52c0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% cache key:'ne-services' duration:'1800' %} | |
{% assign domain = "https://9embers.online.church" %} | |
{% assign jsonResults = '' %} | |
{% webrequest url:'{{domain}}/auth/guest' method:'POST' return:'auth' %} | |
{%- assign dateTimeNow = 'Now' | Date:'yyyy-MM-ddTHH:mm:ss zzz' %} | |
{%- capture body -%}{"operationName":"ServicesConnectionQuery","variables":{"limit":1,"from":"{{dateTimeNow}}"},"query":"query ServicesConnectionQuery($from: Timestamp, $limit: Int = 0) {currentOrganization { id servicesConnection(from: $from, limit: $limit) { services { id startTime scheduleTime endTime __typename } __typename } __typename }}"}{%- endcapture -%} | |
{% webrequest url:'{{domain}}/graphql' method:'POST' body:'{{body}}' requestcontenttype:'application/json' headers:'Authorization^Bearer {{auth.access_token}}' %} | |
{% assign jsonResults = results | ToJSON %} | |
{% endwebrequest %} | |
{% endwebrequest %} | |
{% assign rawJSON = jsonResults | ReplaceFirst:'{', '' | ReplaceLast:'}', '' %} | |
{% capture updatedJSON %} | |
{ | |
"domain": "{{ domain }}", | |
{{ rawJSON }} | |
} | |
{% endcapture %} | |
{{ updatedJSON }} | |
{% endcache %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment