{"id":20743676,"url":"https://github.com/vsouza/graphql-handler","last_synced_at":"2025-04-24T05:43:22.601Z","repository":{"id":65983479,"uuid":"81349267","full_name":"vsouza/GraphQL-handler","owner":"vsouza","description":"GraphQL Handler with Swift Perfect Framework","archived":false,"fork":false,"pushed_at":"2018-11-01T02:14:39.000Z","size":11,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-24T05:43:17.076Z","etag":null,"topics":["graphql","graphql-handler","handler","linux","perfect","server-side","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/vsouza.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":"2017-02-08T16:18:44.000Z","updated_at":"2021-01-31T07:28:09.000Z","dependencies_parsed_at":"2023-02-19T18:35:22.717Z","dependency_job_id":null,"html_url":"https://github.com/vsouza/GraphQL-handler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsouza%2FGraphQL-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsouza%2FGraphQL-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsouza%2FGraphQL-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsouza%2FGraphQL-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsouza","download_url":"https://codeload.github.com/vsouza/GraphQL-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573299,"owners_count":21452342,"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":["graphql","graphql-handler","handler","linux","perfect","server-side","swift"],"created_at":"2024-11-17T07:12:21.960Z","updated_at":"2025-04-24T05:43:22.582Z","avatar_url":"https://github.com/vsouza.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Handler\n\n\u003e Swift GraphQL Handler\n\n[![Swift Version][swift-image]][swift-url]\n[![License][license-image]][license-url]\n[![codebeat badge](https://codebeat.co/badges/1c0f9ac0-84e2-4c1d-96ef-5c0094bca263)](https://codebeat.co/projects/github-com-vsouza-graphql-handler-master)\n\nA simple handler implementation of GraphQL using [Perfect](http://perfect.org)\n\n\n## How it works?\n\nA simple route with a `indexHandler` call when `GET` on `/graphql` route.\n\n```swift\nroutes.add(method: .get, uri: \"/graphql\", handler: indexHandler)\n```\n\nDefine your schema with `RootQueries`, `RootMutations`, `CustomTypes` e etc...\n\n```swift\nlet UserType =  try! GraphQLObjectType(\n    name: \"User\",\n    description: \"A user in system\",\n    fields:[\n        \"id\": GraphQLField(\n            type: GraphQLNonNull(GraphQLString),\n            description: \"The id of the user.\"\n        ),\n        \"name\": GraphQLField(\n            type: GraphQLString,\n            description: \"The name of the user.\"\n        ),\n        \"email\": GraphQLField(\n            type: GraphQLString,\n            description: \"The email of the user.\"\n        ),\n    ]\n)\n```\n\nIn handler you will call the GraphQL parser:\n\n```swift\nlet result = try graphql(schema: schema, request: query)\n```\n\n__[GraphQL library](https://github.com/GraphQLSwift/GraphQL)__ returns a `map`\nby default, to get a JSON you should use `result.description` like @paulofaria\nsays here:\n[#1](https://github.com/GraphQLSwift/GraphQL/issues/1#issuecomment-257182572)\n\n\n\n## Usage example\n\n`make run`\n\nlisten on `:8080`\n\n`http://localhost:8080/graphql?query=query{user(id: \"3000\"){id,name,email}}`\n\n\n## Release History\n\n* 0.0.2\n    * Improve Schema and add sample data\n* 0.0.1\n    * Simple handler with basic schema\n\n## Meta\n\nVinicius Souza – [@iamvsouza](https://twitter.com/iamvsouza) – hi@vsouza.com\n\nDistributed under the MIT license. See [License](http://vsouza.mit-license.org/)\n\n[https://github.com/vsouza](https://github.com/vsouza/)\n\n[swift-image]:https://img.shields.io/badge/swift-4.0-orange.svg\n[swift-url]: https://swift.org/\n[license-image]: https://img.shields.io/badge/License-MIT-blue.svg\n[license-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsouza%2Fgraphql-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsouza%2Fgraphql-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsouza%2Fgraphql-handler/lists"}