Repository: mirumee/ariadne

Issue:
Example not working
I followed the example from the documentation
```python
from ariadne import QueryType, gql, make_executable_schema
from ariadne.asgi import GraphQL

type_defs = gql("""
    type Query {
        hello: String!
    }
""")

# Create type instance for Query type defined in our schema...
query = QueryType()

# ...and assign our resolver function to its "hello" field.
@query.field("hello")
def resolve_hello(_, info):
    request = info.context["request"]
    user_agent = request.headers.get("user-agent", "guest")
    return "Hello, %s!" % user_agent

schema = make_executable_schema(type_defs, query)
app = GraphQL(schema, debug=True)
```
I started the app with `uvicorn test:app`, which starts just fine.
But when I browse to http://localhost:8000/ it errors:
```ERROR: Exception in ASGI application
Traceback (most recent call last):
  File "/home/jonas/.local/share/virtualenvs/api-ariadne-WWJK7Q5Z/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 372, in run_asgi
    result = await asgi(self.receive, self.send)
  File "/home/jonas/.local/share/virtualenvs/api-ariadne-WWJK7Q5Z/lib/python3.7/site-packages/ariadne/asgi.py", line 71, in handle_http
    await response(receive, send)
TypeError: __call__() missing 1 required positional argument: 'send'
INFO: ('127.0.0.1', 42908) - "GET / HTTP/1.1" 500
``` 
I'm using ariadne 0.3.0 and tried with uvicorn version 0.7.1, 0.7.0 and 0.6.1


Discussion:
It sounds like you're mixing an ASGI3 server with an ASGI2 version of Ariadne. Please check if the current master branch works for you, it was updated to ASGI3.
It works when I check out master branch.

But, the problem remains that if you follow the steps on https://ariadne.readthedocs.io/en/0.3.0/introduction.html it will fail.
I don't know whether updating the docs is worthwhile as I've seen you're planning to release 0.4.0 soon(ish)?

Hopefully sometime this week we will be releasing Ariadne 0.4 that should update us to ASGI3 and fix this issue.

Resolving patch:
diff --git a/ariadne/asgi.py b/ariadne/asgi.py
--- a/ariadne/asgi.py
+++ b/ariadne/asgi.py
@@ -3,7 +3,7 @@
 
 from graphql import GraphQLError, GraphQLSchema
 from starlette.requests import Request
-from starlette.responses import HTMLResponse, JSONResponse, Response
+from starlette.responses import HTMLResponse, JSONResponse, PlainTextResponse, Response
 from starlette.types import Receive, Scope, Send
 from starlette.websockets import WebSocket, WebSocketState, WebSocketDisconnect
 
@@ -90,14 +90,14 @@ async def extract_data_from_request(
 
     async def render_playground(  # pylint: disable=unused-argument
         self, request: Request
-    ) -> HTMLResponse:
+    ) -> Response:
         return HTMLResponse(PLAYGROUND_HTML)
 
     async def graphql_http_server(self, request: Request) -> Response:
         try:
             data = await self.extract_data_from_request(request)
         except HttpError as error:
-            return Response(error.message or error.status, status_code=400)
+            return PlainTextResponse(error.message or error.status, status_code=400)
 
         context_value = await self.get_context_for_request(request)
         success, response = await graphql(
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@
     package_data={"ariadne": ["py.typed"]},
     install_requires=[
         "graphql-core-next>=1.0.3",
-        "starlette>=0.12.0b3",
+        "starlette<0.13",
         "typing_extensions>=3.6.0",
     ],
     classifiers=CLASSIFIERS,


Test patch: