diff --git a/ariadne/explorer/graphiql.py b/ariadne/explorer/graphiql.py index 8d8915a6d..c177d0c0e 100644 --- a/ariadne/explorer/graphiql.py +++ b/ariadne/explorer/graphiql.py @@ -43,6 +43,7 @@ def __init__( title: str = "Ariadne GraphQL", explorer_plugin: bool = False, default_query: str = DEFAULT_QUERY, + subscription_url: str = "", ) -> None: self.parsed_html = render_template( GRAPHIQL_HTML, @@ -50,6 +51,7 @@ def __init__( "title": title, "enable_explorer_plugin": explorer_plugin, "default_query": escape_default_query(default_query), + "subscription_url": subscription_url, }, ) diff --git a/ariadne/explorer/templates/graphiql.html b/ariadne/explorer/templates/graphiql.html index b52fbdb41..62b59239a 100644 --- a/ariadne/explorer/templates/graphiql.html +++ b/ariadne/explorer/templates/graphiql.html @@ -70,6 +70,11 @@ + + + + + + + + + +''' + snapshots['test_graphiql_explorer_produces_html 1'] = '''\n\n\n \n \n \n Ariadne GraphQL\n \n \n \n \n\n \n
\n
Loading Ariadne GraphQL...
\n
\n\n \n \n\n \n\n \n\n \n \n\n' + b'\n\n\n \n \n \n Ariadne GraphQL\n \n \n \n \n\n \n
\n
Loading Ariadne GraphQL...
\n
\n\n \n \n\n \n\n \n\n \n \n\n' ] snapshots['test_graphiql_html_is_served_on_get_request 1'] = [ - b'\n\n\n \n \n \n Ariadne GraphQL\n \n \n \n \n\n \n
\n
Loading Ariadne GraphQL...
\n
\n\n \n \n\n \n\n \n\n \n \n\n' + b'\n\n\n \n \n \n Ariadne GraphQL\n \n \n \n \n\n \n
\n
Loading Ariadne GraphQL...
\n
\n\n \n \n\n \n\n \n\n \n \n\n' ] snapshots['test_playground_html_is_served_on_get_request 1'] = [