Skip to content

Commit 6094639

Browse files
committed
Add graphoptions.enabled
1 parent 3118c76 commit 6094639

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

graph_demo_app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ async def request_context(service: wireup.Injected[RequestContextService]) -> di
5959
container,
6060
app,
6161
class_based_handlers=[DemoClassBasedHandler],
62-
graph_endpoint=GraphEndpointOptions(base_module="graph_demo_app"),
62+
graph_endpoint=GraphEndpointOptions(enabled=True, base_module="graph_demo_app"),
6363
)

wireup/integration/fastapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class _ClassBasedHandlersProtocol(Protocol):
6262

6363
@dataclass(frozen=True)
6464
class GraphEndpointOptions:
65+
enabled: bool
6566
base_module: Optional[str] = None
6667

6768

@@ -283,7 +284,7 @@ def setup(
283284
"""
284285
app.state.wireup_container = container
285286
_expose_wireup_task(container)
286-
if graph_endpoint is not None:
287+
if graph_endpoint is not None and graph_endpoint.enabled:
287288
_setup_graph_routes(app, options=graph_endpoint)
288289
if middleware_mode:
289290
app.add_middleware(WireupAsgiMiddleware, include_websocket=False)

0 commit comments

Comments
 (0)