Skip to content

Commit

Permalink
fix(graphql): support string interpolation for subscriptionsEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jun 12, 2023
1 parent 97f1d1a commit e4f94eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-vans-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/graphql': patch
---

Support string interpolation for `subscriptionsEndpoint`
5 changes: 5 additions & 0 deletions .changeset/short-candles-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/graphql': patch
---

Support string interpolation for `subscriptionsEndpoint`
6 changes: 6 additions & 0 deletions packages/handlers/graphql/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getInterpolatedHeadersFactory,
getInterpolatedStringFactory,
parseInterpolationStrings,
stringInterpolator,
} from '@graphql-mesh/string-interpolation';
import {
GetMeshSourcePayload,
Expand Down Expand Up @@ -115,8 +116,13 @@ export default class GraphQLHandler implements MeshHandler {

const endpointFactory = getInterpolatedStringFactory(endpoint);
const operationHeadersFactory = getInterpolatedHeadersFactory(operationHeaders);

const subscriptionsEndpoint = httpSourceConfig.subscriptionsEndpoint
? stringInterpolator.parse(httpSourceConfig.subscriptionsEndpoint, { env: process.env })
: undefined;
const executor = this.urlLoader.getExecutorAsync(endpoint, {
...httpSourceConfig,
subscriptionsEndpoint,
subscriptionsProtocol: httpSourceConfig.subscriptionsProtocol as SubscriptionProtocol,
customFetch: this.fetchFn,
});
Expand Down

0 comments on commit e4f94eb

Please sign in to comment.