|
1 |
| -"""Based on (express-graphql)[https://github.com/graphql/express-graphql/blob/master/src/renderGraphiQL.js] and |
| 1 | +"""Based on (express-graphql)[https://github.com/graphql/express-graphql/blob/main/src/renderGraphiQL.ts] and |
2 | 2 | (subscriptions-transport-ws)[https://github.com/apollographql/subscriptions-transport-ws]"""
|
3 | 3 | import json
|
4 | 4 | import re
|
|
7 | 7 | from jinja2 import Environment
|
8 | 8 | from typing_extensions import TypedDict
|
9 | 9 |
|
10 |
| -GRAPHIQL_VERSION = "1.0.3" |
| 10 | +GRAPHIQL_VERSION = "1.4.7" |
11 | 11 |
|
12 | 12 | GRAPHIQL_TEMPLATE = """<!--
|
13 | 13 | The request to this GraphQL server provided the header "Accept: text/html"
|
|
34 | 34 | }
|
35 | 35 | </style>
|
36 | 36 | <link href="//cdn.jsdelivr.net/npm/graphiql@{{graphiql_version}}/graphiql.css" rel="stylesheet" />
|
37 |
| - <script src="//cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.min.js"></script> |
38 |
| - <script src="//cdn.jsdelivr.net/npm/unfetch@4.1.0/dist/unfetch.umd.js"></script> |
39 |
| - <script src="//cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js"></script> |
40 |
| - <script src="//cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js"></script> |
| 37 | + <script src="//cdn.jsdelivr.net/npm/promise-polyfill@8.2.0/dist/polyfill.min.js"></script> |
| 38 | + <script src="//cdn.jsdelivr.net/npm/unfetch@4.2.0/dist/unfetch.umd.js"></script> |
| 39 | + <script src="//cdn.jsdelivr.net/npm/react@16.14.0/umd/react.production.min.js"></script> |
| 40 | + <script src="//cdn.jsdelivr.net/npm/react-dom@16.14.0/umd/react-dom.production.min.js"></script> |
41 | 41 | <script src="//cdn.jsdelivr.net/npm/graphiql@{{graphiql_version}}/graphiql.min.js"></script>
|
42 |
| - <script src="//cdn.jsdelivr.net/npm/[email protected].16/browser/client.js"></script> |
| 42 | + <script src="//cdn.jsdelivr.net/npm/[email protected].18/browser/client.js"></script> |
43 | 43 | <script src="//cdn.jsdelivr.net/npm/[email protected]/browser/client.js"></script>
|
44 | 44 | </head>
|
45 | 45 | <body>
|
@@ -308,9 +308,8 @@ async def render_graphiql_async(
|
308 | 308 | jinja_env: Optional[Environment] = config.get("jinja_env")
|
309 | 309 |
|
310 | 310 | if jinja_env:
|
311 |
| - # This method returns a Template. See https://jinja.palletsprojects.com/en/2.11.x/api/#jinja2.Template |
312 | 311 | template = jinja_env.from_string(graphiql_template)
|
313 |
| - if jinja_env.is_async: # type: ignore |
| 312 | + if jinja_env.is_async: |
314 | 313 | source = await template.render_async(**template_vars)
|
315 | 314 | else:
|
316 | 315 | source = template.render(**template_vars)
|
|
0 commit comments