{"id":23782583,"url":"https://github.com/joinhandshake/querl","last_synced_at":"2025-09-06T01:32:43.056Z","repository":{"id":65659114,"uuid":"528492208","full_name":"joinhandshake/Querl","owner":"joinhandshake","description":"A minimal GraphQL client library for iOS","archived":false,"fork":false,"pushed_at":"2023-06-01T20:50:56.000Z","size":68,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-08T17:03:20.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joinhandshake.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":"2022-08-24T15:51:36.000Z","updated_at":"2024-04-04T06:16:55.000Z","dependencies_parsed_at":"2023-02-18T09:46:12.449Z","dependency_job_id":null,"html_url":"https://github.com/joinhandshake/Querl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joinhandshake%2FQuerl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joinhandshake%2FQuerl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joinhandshake%2FQuerl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joinhandshake%2FQuerl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joinhandshake","download_url":"https://codeload.github.com/joinhandshake/Querl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232076655,"owners_count":18469237,"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":"2025-01-01T12:16:13.536Z","updated_at":"2025-01-01T12:16:14.175Z","avatar_url":"https://github.com/joinhandshake.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Querl\n\n[![CI Status](https://img.shields.io/travis/joinhandshake/Querl.svg?style=flat)](https://travis-ci.org/joinhandshake/Querl)\n[![Version](https://img.shields.io/cocoapods/v/Querl.svg?style=flat)](https://cocoapods.org/pods/Querl)\n[![License](https://img.shields.io/cocoapods/l/Querl.svg?style=flat)](https://cocoapods.org/pods/Querl)\n[![Platform](https://img.shields.io/cocoapods/p/Querl.svg?style=flat)](https://cocoapods.org/pods/Querl)\n\nQuerl is a minimal GraphQL client library. It aims to be agnostic as to the architecture and technology choices of your app. It can be used with any networking stack, and makes no assumptions about how your models are defined. In addition, it is as Swift-y as possible: protocol-oriented, type-safe, and chock full of generics. It has no dependencies, and comprises less than 200 lines of easily auditable code.\n\nQuerl is not a GraphQL query construction library. Rather than providing a framework or DSL to build queries at compile-time, Querl expects you to use your preferred testing tool ([Paw](https://paw.cloud), [Postman](https://www.postman.com), [Graphiql](https://github.com/graphql/graphiql), [Insomnia](https://insomnia.rest), and so on) to generate a static `.graphql` file, which Querl reads from disk.\n\n## Features\n\nQuerl supports the following GraphQL features:\n* Single-model queries\n* Mutations\n* Paginated queries\n* Variables\n* Fragments\n* Type conditions\n* Directives\n* Aliasing\n\nIt supports those GraphQL features with these Swift language features:\n* Composable, extensible query protocols\n* Strongly-typed arguments and responses\n* Bring your own model types\n\nQuerl does *not* (yet) support the following GraphQL features:\n* Queries returning multiple top-level models\n* Subscriptions\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\nThe code can be as simple as this:\n\n#### `CountryForCode.graphql`\n```\nquery($code: ID!) {\n    country(code: $code) {\n        name\n    }\n}\n```\n#### `main.swift`\n```swift\nimport Querl\n\nstruct CountryForCode: Query, HasArguments {\n    struct Response: Decodable {\n        let country: Country?\n    }\n    let code: String\n}\n\nlet query = CountryForCode(code: \"US\")\nlet request = URLRequest(url: graphQLEndpoint)\nrequest.httpMethod = \"POST\"\nrequest.setValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\nrequest.httpBody = try JSONSerialization.data(withJSONObject: query.body)\nlet (data, _) = try await URLSession.shared.data(for: request)\nlet country = try CountryForCode.decodeResponse(data).country // \"United States of America\"\n```\n\nThis pattern can be easily adapted to Alamofire, or any other networking library that performs `POST` requests.\n\n## Requirements\n\nQuerl requires iOS 11.0 or higher. \n\n## Installation\n\n### CocoaPods\n\nQuerl is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Querl'\n```\n\n### Swift Package Manager\n\nDeclare Querl as a package dependency.\n```ruby\n.package(\n    name: \"Querl\", \n    url: \"https://github.com/joinhandshake/Querl\", \n    .upToNextMinor(from: \"0.1.0\")),\n```\nUse Querl in target dependencies\n```ruby\n.product(name: \"Querl\", package: \"Querl\")\n ```\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/joinhandshake/.github/blob/main/CONTRIBUTING.md) for more information. Contributions are welcome!\n\n## Code of Conduct\n\nSee [CODE_OF_CONDUCT.md](https://github.com/joinhandshake/.github/blob/main/CODE_OF_CONDUCT.md) for more information.\n\n## Author\n\nJoel Kin, open-source@joinhandshake.com, [@foon@mastodon.social](http://mastodon.social/@foon)\n\n## License\n\nQuerl is available under the Apache 2.0 license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoinhandshake%2Fquerl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoinhandshake%2Fquerl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoinhandshake%2Fquerl/lists"}