{"id":13535160,"url":"https://github.com/Saelyria/Artemis","last_synced_at":"2025-04-02T00:32:45.240Z","repository":{"id":45127669,"uuid":"192141635","full_name":"Saelyria/Artemis","owner":"Saelyria","description":"Write GraphQL queries like SwiftUI views - no strings, no dictionaries.","archived":false,"fork":false,"pushed_at":"2022-09-12T22:27:20.000Z","size":617,"stargazers_count":63,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-24T15:02:22.537Z","etag":null,"topics":["artemis","function-builder","graphql","ios","macos","result-builder","swift"],"latest_commit_sha":null,"homepage":"","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/Saelyria.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-16T02:21:54.000Z","updated_at":"2023-08-31T08:56:53.000Z","dependencies_parsed_at":"2022-08-25T23:01:39.697Z","dependency_job_id":null,"html_url":"https://github.com/Saelyria/Artemis","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saelyria%2FArtemis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saelyria%2FArtemis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saelyria%2FArtemis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saelyria%2FArtemis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saelyria","download_url":"https://codeload.github.com/Saelyria/Artemis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213488542,"owners_count":15594721,"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":["artemis","function-builder","graphql","ios","macos","result-builder","swift"],"created_at":"2024-08-01T08:00:50.554Z","updated_at":"2024-11-02T23:30:50.858Z","avatar_url":"https://github.com/Saelyria.png","language":"Swift","readme":"# Artemis\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Saelyria/Artemis/actions/workflows/swift.yml/badge.svg\" alt=\"Build status\" /\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" /\u003e\n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg src=\"https://img.shields.io/badge/swift5.3-compatible-4BC51D.svg?style=flat\" alt=\"Swift 5.3 compatible\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://raw.githubusercontent.com/Saelyria/Artemis/master/LICENSE\"\u003e\u003cimg src=\"http://img.shields.io/badge/license-MIT-blue.svg?style=flat\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nArtemis is a GraphQL library for Swift that lets you interact with a GraphQL backend entirely in Swift - no unsafe queries made of strings,\nno `Data` or `[String: Any]` responses you need to parse though manually. Artemis uses various Swift features to keep track of types used \nin queries, so this request:\n\n```swift\n// Artemis                                              // Rendered GraphQL query   \n.query {                                                query {   \n    $0.country(arguments: .init(code: \"CA\")) {              country(code: \"CA\") {       \n        $0.name                                                 name\n        $0.continent {                                          continent {\n            $0.name(alias: \"continentName\")                         continentName: name\n        }                                                       }\n    }                                                       }\n}                                                       }\n```\n\n...is entirely type-checked - we can't add fields not on our schema, put fields in the wrong place, pass invalid arguments, or pass \ninvalid types for our arguments.\n\nPerforming that query results in a `Partial\u003cCountry\u003e` object that you can interact with using the same keypaths and type inference \nas a normal `Country` instance. Artemis will populate the response object with the fetched data - so this query (and its response) \nare handled like this:\n\n```swift\nlet client = Client\u003cQuery\u003e()\n\nclient.perform(.query { ... }) { result in\n    switch result {\n    case .success(let country):\n        country.name // \"Canada\"\n        country.continent?.name(alias: \"continentName\") // \"North America\"\n        country.languages // nil\n    case .failure(let error):\n        // error handling\n    }\n}\n```\n\nThe schema representation in Swift is also very readable and maintains a reasonably close resemblance to the GraphQL schema syntax. \nA schema for the above query might look something like this:\n\n```swift\n// Artemis                                          // Original GraphQL schema\nfinal class Query: Object {                         type Query {\n    @Field(\"country\")                                   country(code: String!): Country!\n    var country: (Country, CountryArgs.Type)        }\n                                                \n    struct CountryArgs: ArgumentsList {             type Country {\n        var code: String                                name: String!\n    }                                                   languages: [String!]!\n}                                                       continent: Continent!\n                                                    }\nfinal class Country: Object {                    \n    @Field(\"name\")                                  type Continent {\n    var name: String                                    name: String!\n                                                    }\n    @Field(\"languages\")\n    var languages: [String]\n\n    @Field(\"continent\")\n    var continent: Continent\n}\n\nfinal class Continent: Object {\n    @Field(\"name\")\n    var name: String\n}\n\n```\n\nDon't let this simple example sell Artemis short, though - it includes full support for fragments, arguments, interfaces, inputs, aliases, \nmutations, and multiple query fields. It's also very light (requiring only `Foundation`), so supports iOS, macOS, or anywhere else Swift \nand Foundation can run.\n\nArtemis can be added to any project using Swift Package Manager. \n\nOnce you have it added to a project, you can check out the tutorial on [getting started with Artemis](https://github.com/Saelyria/Artemis/tree/master/GettingStarted.md)\nguide to get up and running with making requests.\n\n## Contributors\n\nAaron Bosnjak (email: aaron.bosnjak707@gmail.com, Twitter: @aaron_bosnjak)\n\nArtemis is open to contributors! If you have a feature idea or a bug fix, feel free to open a pull request. Issues and feature ideas are tracked on\nthis [Trello board](https://trello.com/b/iDjeDfov/artemis).\n\n## License\n\nArtemis is available under the MIT license, so do pretty much anything you want with it. As always, see the LICENSE file for more info.\n","funding_links":[],"categories":["Swift","GraphQL"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaelyria%2FArtemis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSaelyria%2FArtemis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaelyria%2FArtemis/lists"}