Skip to content

Commit b0e48d5

Browse files
EmrysMyrddinenisdenjo
authored andcommitted
docs(gateway): add migration for subgraph name of execution requests (#6894)
1 parent 6680e83 commit b0e48d5

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/web/docs/src/content/migration-guides/gateway-v1-v2.mdx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ v2 includes several breaking changes and improvements over v1. The most signific
1414
- [Disabled Automatic Forking](#disabled-automatic-forking)
1515
- [New Hive Logger for next-level observability and debugging](#hive-logger)
1616
- [New OpenTelemetry integration for better traces and custom spans](#opentelemetry)
17+
- [Subgraph Name is now part of the Execution Request](#)
1718

1819
## Drop Support for Node v18
1920

@@ -566,7 +567,8 @@ informations.
566567

567568
#### Example with HTTP OTLP Exporter
568569

569-
<Tabs items={[<div>Hive Gateway <code>openTelemetrySetup()</code> (recommended)</div>, <div>OpenTelemetry <code>NodeSDK</code></div>]}>
570+
<Tabs items={[<div>Hive Gateway <code>openTelemetrySetup()</code> (recommended)</div>,
571+
<div>OpenTelemetry <code>NodeSDK</code></div>]}>
570572

571573
<Tabs.Tab>
572574

@@ -817,3 +819,22 @@ export const myPlugin = () => ({
817819
}
818820
})
819821
```
822+
823+
## Subgraph Name in Execution Request
824+
825+
The targeted subgraph name is now exposed as a field of `ExecutionRequest`, it is no longer needed
826+
to use `subgraphNameFromExecutionRequest` to know which subgraph is targeted by an execution
827+
request.
828+
829+
The `subgraphNameFromExecutionRequest` has been removed, since it's no longer needed.
830+
831+
```diff
832+
- import { subgraphNameByExecutionRequest } from '@graphql-mesh/fusion-runtime';
833+
834+
const useMyPlugin = () => ({
835+
onFetch({ executionRequest }) {
836+
- const subgraphName = subgraphNameByExecutionRequest.get(executionRequest)
837+
+ const subgraphName = executionRequest.subgraphName
838+
}
839+
})
840+
```

0 commit comments

Comments
 (0)