{"id":16989551,"url":"https://github.com/jottenlips/festivalschedule-watchapp","last_synced_at":"2026-05-03T07:32:54.322Z","repository":{"id":101733244,"uuid":"172267084","full_name":"jottenlips/FestivalSchedule-WatchApp","owner":"jottenlips","description":"👩‍🎤 Configuring an Apollo GraphQL client for iOS paired with a WatchOS app (presentation code) ⌚️","archived":false,"fork":false,"pushed_at":"2020-07-12T16:24:34.000Z","size":7994,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T06:08:21.471Z","etag":null,"topics":["apollo","graphql","ios","swift","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jottenlips.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-23T21:39:20.000Z","updated_at":"2020-07-12T16:24:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"56dccce0-04d2-4fa4-b5ef-4e8ffb655f19","html_url":"https://github.com/jottenlips/FestivalSchedule-WatchApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2FFestivalSchedule-WatchApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2FFestivalSchedule-WatchApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2FFestivalSchedule-WatchApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2FFestivalSchedule-WatchApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jottenlips","download_url":"https://codeload.github.com/jottenlips/FestivalSchedule-WatchApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jottenlips%2FFestivalSchedule-WatchApp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114577,"owners_count":22807252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","graphql","ios","swift","watchos"],"created_at":"2024-10-14T03:07:03.562Z","updated_at":"2026-05-03T07:32:54.294Z","avatar_url":"https://github.com/jottenlips.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Making a GraphQL iOS App with Apollo\n## 📈💖🍏\n*presentation code*\n## Client Setup\n**Install Apollo**\n\n\u003e `npm install -g apollo`\n\n\u003e `npm install -g apollo-codegen`\n\n**Setup Project**\n\u003e- run `gem install cocoapods`\n\u003e- make a new iOS project\n\u003e- Add Apollo's GraphQL pod to your podfile\n\u003e- `cd newProjectName`\n\u003e- run `pod install`\n\n**Grab schema from your endpoint**\n\u003e- In this case I will grab it from the production endpoint\n\u003e\n\u003e `\napollo schema:download --endpoint=https://api.aloompa.com/graphql schema.json`\n\u003e- get or make your .graphql file \n\u003e\n\u003e `touch queries.graphql`\n\u003e \n\u003e `vim queries.graphql`\n\u003e- ### 👩‍🏫 learn vim\n```\nquery Performers($id: String!)  {\n        festapp(id: $id) {\n            name\n            startsAt\n            events {\n                performers {\n                    name\n                }\n                name\n                startsAt\n            }\n         }\n}\n\n```\n\u003e- Generate your api code 😮\n\u003e\n\u003e`apollo-codegen generate **/*.graphql --schema schema.json --output API.swift`\n\u003e- Add *queries.graphql and API.swift* to your xcodeworkspace\n\u003e- Apollo code to add to your class or delegate\n\n```\nimport Apollo\n\nvar 👩‍🚀: ApolloClient {\n    return configureApollo()\n}\n\nfunc configureApollo() -\u003e ApolloClient {\n    let configuration = URLSessionConfiguration.default\n    configuration.httpAdditionalHeaders = CONFIG_HEADERS;\n    let url = URL(string: \"https://api.aloompa.com/graphql\")!\n    let 👩‍🚀 = ApolloClient(networkTransport: HTTPNetworkTransport(url: url, configuration: configuration))\n    👩‍🚀.cacheKeyForObject = { $0[\"id\"] }\n    return 👩‍🚀;\n}\n\n```\n\u003e- config.swift \n\n```\nlet CONFIG_HEADERS = [\"applicationtoken\": \"\", \"authorization\": \"\"]\n```\n\n**Running GQL server locally** *(optional)*\n\u003e `cd ~/`\n\n\u003e `mkdir aloompaApis`\n\n\u003e `cd aloompaApis`\n\n\u003e `git clone git@github.com:Aloompa/aloompa-api-graphql.git`\n\n\u003e `git clone git@github.com:Aloompa/citizen-users-api.git`\n\n\u003e `git clone git@github.com:Aloompa/festapi-graphql.git`\n\n\u003e run `npm i` in all directories\n\n\u003e cd `aloompa-api-graphql`\n\n\u003e run `npm run start:local` or `python start.py`\n\n\u003e Should be running on **Port 9000**\n\n## Why we are here\n\n```\n   func loadData() {\n        let watcher = apollo.watch(query: PerformersQuery(id: someIdString)) { (result, error) in\n            if let error = error {\n                NSLog(\"Error while fetching query: \\(error.localizedDescription)\")\n                return\n            }\n            // some lazy global variable should do\n            self.festapp = result?.data?.festapp\n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Ffestivalschedule-watchapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjottenlips%2Ffestivalschedule-watchapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjottenlips%2Ffestivalschedule-watchapp/lists"}