{"id":13499547,"url":"https://github.com/manicmaniac/ApolloDeveloperKit","last_synced_at":"2025-03-29T05:31:42.617Z","repository":{"id":34931386,"uuid":"192216123","full_name":"manicmaniac/ApolloDeveloperKit","owner":"manicmaniac","description":"Visual debugger for Apollo iOS GraphQL client","archived":false,"fork":false,"pushed_at":"2023-01-07T06:26:57.000Z","size":5335,"stargazers_count":64,"open_issues_count":20,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T08:41:20.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://manicmaniac.github.io/ApolloDeveloperKit/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manicmaniac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-16T17:00:27.000Z","updated_at":"2024-11-23T02:16:37.000Z","dependencies_parsed_at":"2023-01-15T10:45:19.914Z","dependency_job_id":null,"html_url":"https://github.com/manicmaniac/ApolloDeveloperKit","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manicmaniac%2FApolloDeveloperKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manicmaniac%2FApolloDeveloperKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manicmaniac%2FApolloDeveloperKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manicmaniac%2FApolloDeveloperKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manicmaniac","download_url":"https://codeload.github.com/manicmaniac/ApolloDeveloperKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246145012,"owners_count":20730494,"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":[],"created_at":"2024-07-31T22:00:34.688Z","updated_at":"2025-03-29T05:31:42.149Z","avatar_url":"https://github.com/manicmaniac.png","language":"Swift","readme":"ApolloDeveloperKit\n==================\n\n[![Build Status](https://github.com/manicmaniac/ApolloDeveloperKit/workflows/Test/badge.svg)](https://github.com/manicmaniac/ApolloDeveloperKit/actions?query=workflow%3A\"Test\")\n[![Maintainability](https://api.codeclimate.com/v1/badges/c45fc7657ce194edee35/maintainability)](https://codeclimate.com/github/manicmaniac/ApolloDeveloperKit/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/c45fc7657ce194edee35/test_coverage)](https://codeclimate.com/github/manicmaniac/ApolloDeveloperKit/test_coverage)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ApolloDeveloperKit.svg)](https://cocoapods.org/pods/ApolloDeveloperKit)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Platform](https://img.shields.io/cocoapods/p/ApolloDeveloperKit.svg?style=flat)](https://manicmaniac.github.io/ApolloDeveloperKit/)\n\n[Apollo Client Devtools](https://github.com/apollographql/apollo-client-devtools) bridge for [Apollo iOS](https://github.com/apollographql/apollo-ios).\n\nOverview\n--------\n\nApolloDeveloperKit is an iOS / macOS library which works as a bridge between Apollo iOS client and [Apollo Client Developer tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools).\n\nThis library adds an ability to watch the sent queries or mutations simultaneously, and also has the feature to request arbitrary operations from embedded GraphiQL console.\n\nScreenshots\n-----------\n\n\u003cimg width=\"1332\" alt=\"apollo-developer-kit-animation\" src=\"https://user-images.githubusercontent.com/1672393/62706435-0db01580-b9df-11e9-9033-cb8055074b91.gif\"\u003e\n\nPrerequisites\n-------------\n\n- Xcode `\u003e= 12.0`\n- [Apollo iOS](https://github.com/apollographql/apollo-ios) `\u003e= 0.34.0`, `\u003c 0.38.0`\n- [Apollo Client Devtools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools) `~\u003e 2.0`\n\nCompatibility\n-------------\n\nIf your are using `Apollo \u003c 0.34.0`, use `ApolloDeveloperKit \u003c= 0.15.0`.\n\nInstallation\n------------\n\n### CocoaPods\n\nAdd the following lines to your Podfile.\n\n```ruby\npod 'Apollo'\npod 'ApolloDeveloperKit', '~\u003e 0.15.0', configurations: ['Debug']\n```\n\nThen run `pod install`.\n\n### Carthage\n\nAdd the following lines to your Cartfile.\n\n```\ngithub \"apollographql/apollo-ios\"\ngithub \"manicmaniac/ApolloDeveloperKit\"\n```\n\nThen run `carthage update --platform iOS --use-xcframeworks` or `carthage update --platform Mac --use-xcframeworks`.\n\nYou just need to drag and drop `ApolloDeveloperKit.xcframework` to your project.\n\n### Swift Package Manager\n\nAdd `https://github.com/manicmaniac/ApolloDeveloperKit` to your dependencies.\n\nSince Xcode 12 has only limited support for resources installed via Swift Package Manager, I recommend to use Xcode 12.4 or newer for Swift Package Manager users.\n\nSetup\n-----\n\nFirst, you need to declare a long-lived variable where `ApolloDebugServer` belongs to, because as soon as you release the server, it stops running.\n\nThe following code assumes you already have a procedure that instantiates `ApolloClient` in `AppDelegate`.\n\n```\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    private var server: ApolloDebugServer!\n    private var client: ApolloClient!\n}\n```\n\nIn order to hook Apollo's cache and network layer, you need to use `DebuggableRequestChainNetworkTransport` and `DebuggableNormalizedCache` instead of usual `RequestChainNetworkTransport` and `NormalizedCache`.\n\nSo the second step is to declare `ApolloStore` using `DebuggableNormalizedCache`.\n\nNormally it should be put in the beginning of application, like `UIApplication.application(_:didFinishLaunchingWithOptions:)`.\n\n```swift\nlet cache = DebuggableNormalizedCache(cache: InMemoryNormalizedCache())\nlet store = ApolloStore(cache: cache)\n```\n\nThird, configure network layer and instantiate `ApolloClient` with debuggable ingredients.\n\n```swift\nlet interceptorProvider = LegacyInterceptorProvider(store: store)\nlet networkTransport = DebuggableRequestChainNetworkTransport(interceptorProvider: interceptorProvider, endpointURL: url)\nself.client = ApolloClient(networkTransport: networkTransport: store: store)\n```\n\nFinally, create `ApolloDebugServer` and run.\n\n```swift\nself.server = ApolloDebugServer(networkTransport: networkTransport, cache: cache)\nself.server.start(port: 8081)\n```\n\nSee `Example/{iOS,macOS}/AppDelegate.swift` for full examples.\n\nUsage\n-----\n\n**If you don't have [Apollo Client Developer Tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools), install it before proceeding the following steps.**\n\n**Currently `ApolloDeveloperKit` supports only version 2.x of Apollo Client Developer Tools.**\n\n1. Launch your app on your device or simulator.\n2. Open your browser and jump to the server's URL (in case your app runs the above example on a simulator, the URL would be `http://localhost:8081`).\n    - You will see `ApolloDebugServer is running!` on your browser's tab.\n    - If not, make sure the server runs and the specified URL is correct.\n    - On a real device, the host would be other than `localhost` but you can check what it is with `ApolloDebugServer.serverURL`.\n3. Open developer tools.\n    - [In Google Chrome](https://developers.google.com/web/tools/chrome-devtools/open)\n    - [In Mozilla Firefox](https://developer.mozilla.org/docs/Tools)\n4. Select `Apollo` tab.\n    - You will see tabs like `GraphiQL`, `Queries`, `Mutations` on the left pane.\n    - If not, reload the tab and wait until it's connected again.\n\nExcluding ApolloDeveloperKit from Release (App Store) Builds\n------------------------------------------------------------\n\nAll instructions in this section are written based on [Flipboard/FLEX](https://github.com/Flipboard/FLEX)'s way.\n\nSince ApolloDeveloperKit is originally designed for debug use only, it should not be exposed to end-users.\n\nFortunately, it is easy to exclude ApolloDeveloperKit framework from Release builds. The strategies differ depending on how you integrated it in your project, and are described below.\n\nPlease make sure your code is properly excluding ApolloDeveloperKit with `#if DEBUG` statements before starting these instructions.\nOtherwise it will be linked to your app unexpectedly.\nSee `Example/AppDelegate.swift` to see how to do it.\n\n### For CocoaPods users\n\nCocoaPods automatically excludes ApolloDeveloperKit from release builds if you only specify the Debug configuration for CocoaPods in your Podfile.\n\n### For Carthage users\n\n1. Do NOT add `ApolloDeveloperKit.framework` to the embedded binaries of your target, as it would otherwise be included in all builds (therefore also in release ones).\n2. Instead, add `$(PROJECT_DIR)/Carthage/Build/iOS` or `$(PROJECT_DIR)/Carthage/Build/Mac` to your target *Framework Search Paths* (this setting might already be present if you already included other frameworks with Carthage).\nThis makes it possible to import the ApolloDeveloperKit framework from your source files. It does not harm if this setting is added for all configurations, but it should at least be added for the debug one.\n3. Add a *Run Script Phase* to your target (inserting it alter the existing `Link Binary with Libraries` phase, for example), and which will embed `ApolloDeveloperKit.framework` in debug builds only:\n\n```bash\nif [ \"$CONFIGURATION\" = Debug ]; then\n  /usr/local/bin/carthage copy-frameworks\nfi\n```\n\nFinally, add `$(SRCROOT)/Carthage/Build/iOS/ApolloDeveloperKit.framework` or `$(SRCROOT)/Carthage/Build/Mac/ApolloDeveloperKit.framework` as input file of this script phase.\n\n### For users those who copy all the source files to the project manually\n\nNow there's no easy way but you can exclude ApolloDeveloperKit by setting user defined build variable named `EXCLUDED_SOURCE_FILE_NAMES`.\nThe value for the variable is a space-separated list of each filenames in ApolloDeveloperKit.\nSorry for the inconvenience.\n\nConsole Redirection\n-------------------\n\n`ApolloDeveloperKit` supports console redirection.\nWhen it is enabled, all logs written in stdout (usually written with `print()`) and stderr (written with `NSLog()`) are redirected to the web browser's console as well.\n\nThis feature is disabled by default so you may want to enable it explicitly.\n\n```swift\ndebugServer = ApolloDebugServer(networkTransport: networkTransport, cache: cache)\ndebugServer.enableConsoleRedirection = true\n```\n\nThen open the console in your browser's developer tools.\nYou will see logs in your iPhone or simulator.\n\nIn the browser console, logs written in stdout are colored in [blue-green](https://www.color-hex.com/color/5f9ea0) and stderr are [orange](https://www.color-hex.com/color/ff6347) so that you can distinguish them from ordinary browser logs.\n\n\u003cimg width=\"1440\" alt=\"console-redirection.png\" src=\"https://user-images.githubusercontent.com/1672393/68502106-07ae2700-02a3-11ea-8d35-02f1280ea625.png\"\u003e\n\nDevelopment\n-----------\n\n### API Documentation\n\nAuto-generated API documentation is [here](https://manicmaniac.github.io/ApolloDeveloperKit).\n\n### Run Example App\n\nSince Example app is slightly modified version of [apollographql/frontpage-ios-app](https://github.com/apollographql/frontpage-ios-app),\nyou need to start [apollographql/frontpage-server](https://github.com/apollographql/frontpage-server) before running the app.\n\n1. Open Xcode and select ApolloDeveloperKitExample scheme.\n2. Run and open `http://localhost:8081` in your browser.\n\nLicense\n-------\n\nThis software is distributed under the MIT license.\nSee LICENSE for more detail.\n","funding_links":[],"categories":["Libraries","Implementations"],"sub_categories":["iOS Libraries","iOS"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanicmaniac%2FApolloDeveloperKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanicmaniac%2FApolloDeveloperKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanicmaniac%2FApolloDeveloperKit/lists"}