{"id":43980429,"url":"https://github.com/graphqlswift/graphql-hummingbird","last_synced_at":"2026-02-07T09:00:55.833Z","repository":{"id":335441843,"uuid":"1145693667","full_name":"GraphQLSwift/graphql-hummingbird","owner":"GraphQLSwift","description":"Easily expose GraphQL APIs in Hummingbird","archived":false,"fork":false,"pushed_at":"2026-02-06T07:28:19.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T15:35:19.585Z","etag":null,"topics":["graphql","hummingbird","server","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/GraphQLSwift.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-30T05:09:35.000Z","updated_at":"2026-02-06T07:27:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/GraphQLSwift/graphql-hummingbird","commit_stats":null,"previous_names":["needleinajaystack/graphql-hummingbird","graphqlswift/graphql-hummingbird"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/GraphQLSwift/graphql-hummingbird","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLSwift%2Fgraphql-hummingbird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLSwift%2Fgraphql-hummingbird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLSwift%2Fgraphql-hummingbird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLSwift%2Fgraphql-hummingbird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GraphQLSwift","download_url":"https://codeload.github.com/GraphQLSwift/graphql-hummingbird/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraphQLSwift%2Fgraphql-hummingbird/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29190842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","hummingbird","server","swift"],"created_at":"2026-02-07T09:00:43.035Z","updated_at":"2026-02-07T09:00:55.828Z","avatar_url":"https://github.com/GraphQLSwift.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQLHummingbird\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2Fgraphql-hummingbird%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/GraphQLSwift/graphql-hummingbird)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2Fgraphql-hummingbird%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/GraphQLSwift/graphql-hummingbird)\n\n\u003e ***WARNING***: This package is in v0.x beta. It's API is still evolving and is subject to breaking changes in minor version bumps.\n\nA Swift library for integrating [GraphQL](https://github.com/GraphQLSwift/GraphQL) with [Hummingbird](https://github.com/hummingbird-project/hummingbird), enabling you to easily expose GraphQL APIs in your Hummingbird applications.\n\n## Features\n\n- Simple integration of GraphQL schemas with Hummingbird routing\n- Compatibility with the [GraphQL over HTTP spec](https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md)\n- Subscription support using WebSockets, with support for [`graphql-transport-ws`](https://github.com/GraphQLSwift/GraphQLTransportWS) and [`graphql-ws`](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md) subprotocols\n- Built-in [GraphiQL](https://github.com/graphql/graphiql) IDE\n\n## Installation\n\nAdd GraphQLHummingbird as a dependency in your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/NeedleInAJayStack/graphql-hummingbird.git\", from: \"1.0.0\"),\n]\n```\n\nThen add it to your target:\n\n```swift\n.target(\n    name: \"YourTarget\",\n    dependencies: [\n        .product(name: \"GraphQLHummingbird\", package: \"graphql-hummingbird\"),\n    ]\n)\n```\n\n## Usage\n\nSee [the HelloWorld project](https://github.com/GraphQLSwift/graphql-hummingbird/tree/main/Examples/HelloWorld) for a full working example.\n\n### Basic Example\n\n```swift\nimport GraphQL\nimport GraphQLHummingbird\nimport Hummingbird\n\n// Define your GraphQL schema\n// To construct schemas, consider using `Graphiti` or `graphql-generator`\nlet schema = try GraphQLSchema(\n    query: GraphQLObjectType(\n        name: \"Query\",\n        fields: [\n            \"hello\": GraphQLField(\n                type: GraphQLString,\n                resolve: { _, _, _, _ in\n                    \"World\"\n                }\n            )\n        ]\n    )\n)\n\n// Define your Context\nstruct GraphQLContext: Sendable {}\n\n// Create router and register GraphQL\nlet router = Router()\nrouter.graphql(schema: schema) { _, _ in\n    return GraphQLContext()\n}\n\n// Create and run the application\nlet app = Application(\n    router: router,\n    configuration: .init(address: .hostname(\"127.0.0.1\", port: 8080))\n)\ntry await app.runService()\n```\n\nThat's it! You can now view the GraphiQL IDE at http://localhost:8080/graphql, or query directly using `GET` or `POST`:\n\n```bash\ncurl -X POST http://localhost:8080/graphql \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"{ hello }\"}'\n```\n\nResponse:\n```json\n{\n  \"data\": {\n    \"hello\": \"World\"\n  }\n}\n```\n\nSee the `graphql` function documentation for advanced configuration options.\n\n### WebSockets\n\nSubscription support via WebSockets can be enabled by calling the `graphqlWebSocket` function on a `Router` whose context conforms to `WebSocketRequestContext`, from the `HummingbirdWebSocket` package:\n\n```swift\nimport GraphQL\nimport GraphQLHummingbird\nimport Hummingbird\nimport HummingbirdWebSocket\n\nstruct MyWebSocketContext: WebSocketRequestContext, RequestContext {\n    ...\n}\n\nlet router = Router(context: MyContext.self)\nrouter.graphql(schema: schema) { _, _ in\n    GraphQLContext()\n}\nlet webSocketRouter = Router(context: MyWebSocketContext.self)\nwebSocketRouter.graphqlWebSocket(schema: schema) { _, _ in\n    GraphQLContext()\n}\nlet app = Application(\n    router: router,\n    server: .http1WebSocketUpgrade(webSocketRouter: webSocketRouter)\n)\n```\n\nThe example above follows Hummingbird best practices when it uses a separate router for HTTP and WebSocket requests. For more details, see the [Hummingbird WebSocket documentation](https://docs.hummingbird.codes/2.0/documentation/hummingbird/websocketserverupgrade#Overview).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphqlswift%2Fgraphql-hummingbird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphqlswift%2Fgraphql-hummingbird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphqlswift%2Fgraphql-hummingbird/lists"}