Repository: strawberry-graphql/strawberry

Issue:
Deprecate starlite
Now that we Litestar support I think we can deprecate Starlite 😊


```[tasklist]
### Tasks
- [ ] Add notice in the docs
- [ ] Use typing_extensions.deprecated to mark class as deprecated (see https://peps.python.org/pep-0702/)
- [ ] Trigger deprecation warning (with test), this might 
```


<!-- POLAR PLEDGE BADGE START -->
## Upvote & Fund

- We're using [Polar.sh](https://polar.sh/strawberry-graphql) so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/strawberry-graphql/strawberry/issues/3359">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/3359/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/3359/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->

Deprecate starlite
Now that we Litestar support I think we can deprecate Starlite 😊


```[tasklist]
### Tasks
- [ ] Add notice in the docs
- [ ] Use typing_extensions.deprecated to mark class as deprecated (see https://peps.python.org/pep-0702/)
- [ ] Trigger deprecation warning (with test), this might 
```


<!-- POLAR PLEDGE BADGE START -->
## Upvote & Fund

- We're using [Polar.sh](https://polar.sh/strawberry-graphql) so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/strawberry-graphql/strawberry/issues/3359">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/3359/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/3359/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->



Discussion:
Hello! Do you mind if I take this issue? Is it still up-to-date and should be done?
@Birdi7 Please feel free to go ahead with this 😊 If you need assistance or a review, feel free to ping me
Hello! Do you mind if I take this issue? Is it still up-to-date and should be done?
@Birdi7 Please feel free to go ahead with this 😊 If you need assistance or a review, feel free to ping me

Resolving patch:
diff --git a/strawberry/starlite/controller.py b/strawberry/starlite/controller.py
--- a/strawberry/starlite/controller.py
+++ b/strawberry/starlite/controller.py
@@ -6,6 +6,7 @@
 from dataclasses import dataclass
 from datetime import timedelta
 from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Tuple, Union, cast
+from typing_extensions import deprecated
 
 from starlite import (
     BackgroundTasks,
@@ -118,6 +119,10 @@ async def get_root_value(self) -> Any:
         return await self._get_root_value()
 
 
+@deprecated(
+    "The `starlite` integration is deprecated in favor of `litestar` integration",
+    stacklevel=2,
+)
 class StarliteRequestAdapter(AsyncHTTPRequestAdapter):
     def __init__(self, request: Request[Any, Any]) -> None:
         self.request = request
@@ -153,6 +158,10 @@ def __init__(self) -> None:
         self.response: Optional[Response] = None
 
 
+@deprecated(
+    "The `starlite` integration is deprecated in favor of `litestar` integration",
+    stacklevel=2,
+)
 def make_graphql_controller(
     schema: BaseSchema,
     path: str = "",


Test patch:
diff --git a/tests/starlite/test_context.py b/tests/starlite/test_context.py
--- a/tests/starlite/test_context.py
+++ b/tests/starlite/test_context.py
@@ -1,5 +1,7 @@
 from typing import Dict
 
+import pytest
+
 import strawberry
 
 try:
@@ -181,3 +183,20 @@ def something(self, info: strawberry.Info) -> str:
 
     assert response.json() == {"data": {"something": "foo"}}
     assert task_complete
+
+
+def test_starlite_usage_triggers_deprecation_warning():
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def abc(self, info: strawberry.Info) -> str:
+            assert info.context.get("request") is not None
+            assert info.context.get("strawberry") is None
+            return "abc"
+
+    schema = strawberry.Schema(query=Query)
+
+    with pytest.deprecated_call(
+        match="The `starlite` integration is deprecated in favor of `litestar` integration"
+    ):
+        make_graphql_controller(path="/graphql", schema=schema, context_getter=None)