Skip to content

Commit

Permalink
Merge pull request #80 from d-exclaimation/fix-variables-subscription
Browse files Browse the repository at this point in the history
Fixed issue with variables not included in Subscriptions
  • Loading branch information
d-exclaimation authored Aug 5, 2022
2 parents 0017b57 + b18bc78 commit 1772117
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can add Pioneer into any existing Vapor application with any GraphQL schema
Add this line to add Pioneer as one of your dependencies.

```swift
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.3")
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.4")
```

Go to the `main.swift` or any Swift file where you apply your Vapor routing like your `routes.swift` file.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/guides/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/GraphQLSwift/Graphiti.git", from: "1.0.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.61.1"),
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.3")
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.4")
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pioneer is an open-source Swift GraphQL server for [Vapor](https://github.com/va
## Setup

```swift
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.3")
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.9.4")
```

## Swift for GraphQL
Expand Down
10 changes: 9 additions & 1 deletion Sources/Pioneer/WebSocket/Probe/Drone/Drone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,15 @@ extension Pioneer {

/// Execute long lived GraphQL Operation as a subscription
private func subscribeOperation(for gql: GraphQLRequest, with ctx: Context, using eventLoop: EventLoopGroup) async throws -> SubscriptionResult {
try await subscribeGraphQL(schema: schema, request: gql.query, resolver: resolver, context: ctx, eventLoopGroup: eventLoop)
try await subscribeGraphQL(
schema: schema,
request: gql.query,
resolver: resolver,
context: ctx,
eventLoopGroup: eventLoop,
variables: gql.variables,
operationName: gql.operationName
)
}

deinit {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pioneer/WebSocket/Probe/Probe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extension Pioneer {
resolver: self.resolver,
context: ctx,
eventLoopGroup: eventLoop,
variables: gql.variables ?? [:],
variables: gql.variables,
operationName: gql.operationName
)
}
Expand Down

0 comments on commit 1772117

Please sign in to comment.