From 8b7a14cc227e7a337adcd75841243d13392af946 Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Sat, 28 Feb 2026 13:30:13 -0700 Subject: [PATCH 1/3] docs: Adds docs on how to use with Graphiti --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 5aef871..790a9eb 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,20 @@ let app = Application( The 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). +### Graphiti + +If using Graphiti to build your GraphQL schema, you must provide an instance of the `Resolver` to the `rootValue` argument. For example: + +```swift +let graphqlSchema: Graphiti.Schema = try graphqlSchema() +router.graphql( + schema: graphqlSchema.schema, + rootValue: Resolver() // This must be included +) { _ in + Context() +} +``` + ### Custom Encoding/Decoding You can set custom encoders and decoders using the `Config.coders` argument: From 413a53158c50ad449655ac9446fdfe9eec5f39ad Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Sat, 28 Feb 2026 13:35:03 -0700 Subject: [PATCH 2/3] docs: Links schema creation packages --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 790a9eb..e4b93e4 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Then add it to your target: ## Usage +To use this package, you must already have a GraphQL schema. You can use [graphql-generator](https://github.com/GraphQLSwift/graphql-generator), [Graphiti](https://github.com/GraphQLSwift/Graphiti), or [GraphQL](https://github.com/GraphQLSwift/GraphQL) to construct one. + See [the HelloWorld project](https://github.com/GraphQLSwift/graphql-hummingbird/tree/main/Examples/HelloWorld) for a full working example. ### Basic Example @@ -45,7 +47,6 @@ import GraphQLHummingbird import Hummingbird // Define your GraphQL schema -// To construct schemas, consider using `Graphiti` or `graphql-generator` let schema = try GraphQLSchema( query: GraphQLObjectType( name: "Query", From 99e7326d9262e40f37b233036481bce1326d8922 Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Sat, 28 Feb 2026 13:42:36 -0700 Subject: [PATCH 3/3] docs: Adds supported websocket subprotocols --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e4b93e4..6eb2524 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,8 @@ let app = Application( The 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). +[`graphql-ws`](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md) and [`graphql-transport-ws`](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md) subprotocols are supported. + ### Graphiti If using Graphiti to build your GraphQL schema, you must provide an instance of the `Resolver` to the `rootValue` argument. For example: