strawberry-graphql 0.288.2__py3-none-any.whl → 0.288.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- strawberry/static/graphiql.html +75 -12
- strawberry/types/arguments.py +10 -0
- {strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/METADATA +5 -5
- {strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/RECORD +7 -7
- {strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/WHEEL +0 -0
- {strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/entry_points.txt +0 -0
- {strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/licenses/LICENSE +0 -0
strawberry/static/graphiql.html
CHANGED
|
@@ -114,7 +114,38 @@
|
|
|
114
114
|
#
|
|
115
115
|
`;
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
// Parse URL parameters for sharing queries
|
|
118
|
+
const parameters = {};
|
|
119
|
+
|
|
120
|
+
for (const entry of window.location.search.slice(1).split("&")) {
|
|
121
|
+
const eq = entry.indexOf("=");
|
|
122
|
+
if (eq >= 0) {
|
|
123
|
+
parameters[decodeURIComponent(entry.slice(0, eq))] =
|
|
124
|
+
decodeURIComponent(entry.slice(eq + 1));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function updateURL(data) {
|
|
129
|
+
Object.assign(parameters, data);
|
|
130
|
+
|
|
131
|
+
const newSearch =
|
|
132
|
+
"?" +
|
|
133
|
+
Object.keys(parameters)
|
|
134
|
+
.filter(function (key) {
|
|
135
|
+
return Boolean(parameters[key]);
|
|
136
|
+
})
|
|
137
|
+
.map(function (key) {
|
|
138
|
+
return (
|
|
139
|
+
encodeURIComponent(key) +
|
|
140
|
+
"=" +
|
|
141
|
+
encodeURIComponent(parameters[key])
|
|
142
|
+
);
|
|
143
|
+
})
|
|
144
|
+
.join("&");
|
|
145
|
+
history.replaceState(null, null, newSearch);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const fetchURL = window.location.href.split("?")[0];
|
|
118
149
|
|
|
119
150
|
function httpUrlToWebSockeUrl(url) {
|
|
120
151
|
const parsedURL = new URL(url);
|
|
@@ -124,33 +155,65 @@
|
|
|
124
155
|
return parsedURL.toString();
|
|
125
156
|
}
|
|
126
157
|
|
|
127
|
-
const
|
|
158
|
+
const defaultHeaders = {};
|
|
128
159
|
const csrfToken = Cookies.get("csrftoken");
|
|
129
160
|
|
|
130
161
|
if (csrfToken) {
|
|
131
|
-
|
|
162
|
+
defaultHeaders["x-csrftoken"] = csrfToken;
|
|
132
163
|
}
|
|
133
164
|
|
|
134
165
|
const subscriptionUrl = httpUrlToWebSockeUrl(fetchURL);
|
|
135
166
|
|
|
136
167
|
const fetcher = GraphiQL.createFetcher({
|
|
137
168
|
url: fetchURL,
|
|
138
|
-
headers:
|
|
169
|
+
headers: defaultHeaders,
|
|
139
170
|
subscriptionUrl,
|
|
140
171
|
});
|
|
141
172
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
173
|
+
function GraphiQLWithExplorer() {
|
|
174
|
+
const [query, setQuery] = React.useState(
|
|
175
|
+
parameters.q || EXAMPLE_QUERY,
|
|
176
|
+
);
|
|
177
|
+
const [variables, setVariables] = React.useState(
|
|
178
|
+
parameters.variables,
|
|
179
|
+
);
|
|
180
|
+
const [headers, setHeaders] = React.useState(parameters.headers);
|
|
181
|
+
|
|
182
|
+
function onEditQuery(newQuery) {
|
|
183
|
+
setQuery(newQuery);
|
|
184
|
+
updateURL({ q: newQuery });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function onEditVariables(newVariables) {
|
|
188
|
+
setVariables(newVariables);
|
|
189
|
+
updateURL({ variables: newVariables });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function onEditHeaders(newHeaders) {
|
|
193
|
+
setHeaders(newHeaders);
|
|
194
|
+
updateURL({ headers: newHeaders });
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const explorerPlugin = GraphiQLPluginExplorer.explorerPlugin();
|
|
198
|
+
|
|
199
|
+
return React.createElement(GraphiQL, {
|
|
148
200
|
fetcher: fetcher,
|
|
149
201
|
defaultEditorToolsVisibility: true,
|
|
150
202
|
plugins: [explorerPlugin],
|
|
203
|
+
query: query,
|
|
204
|
+
variables: variables,
|
|
205
|
+
headers: headers,
|
|
206
|
+
onEditQuery: onEditQuery,
|
|
207
|
+
onEditVariables: onEditVariables,
|
|
208
|
+
onEditHeaders: onEditHeaders,
|
|
151
209
|
inputValueDeprecation: true,
|
|
152
|
-
|
|
153
|
-
|
|
210
|
+
isHeadersEditorEnabled: true,
|
|
211
|
+
shouldPersistHeaders: true,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const root = ReactDOM.createRoot(document.getElementById("graphiql"));
|
|
216
|
+
root.render(React.createElement(GraphiQLWithExplorer));
|
|
154
217
|
</script>
|
|
155
218
|
</body>
|
|
156
219
|
</html>
|
strawberry/types/arguments.py
CHANGED
|
@@ -195,6 +195,16 @@ def convert_argument(
|
|
|
195
195
|
|
|
196
196
|
return Some(res)
|
|
197
197
|
|
|
198
|
+
if value is None:
|
|
199
|
+
from strawberry.exceptions import StrawberryGraphQLError
|
|
200
|
+
|
|
201
|
+
type_name = getattr(type_.of_type, "__name__", str(type_.of_type))
|
|
202
|
+
raise StrawberryGraphQLError(
|
|
203
|
+
f"Expected value of type '{type_name}', found null. "
|
|
204
|
+
f"Field of type 'Maybe[{type_name}]' cannot be explicitly set to null. "
|
|
205
|
+
f"Use 'Maybe[{type_name} | None]' if you need to allow null values."
|
|
206
|
+
)
|
|
207
|
+
|
|
198
208
|
# This is Maybe[T] - validation for null values is handled by MaybeNullValidationRule
|
|
199
209
|
# Convert the value and wrap in Some()
|
|
200
210
|
res = convert_argument(value, type_.of_type, scalar_registry, config)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: strawberry-graphql
|
|
3
|
-
Version: 0.288.
|
|
3
|
+
Version: 0.288.4
|
|
4
4
|
Summary: A library for creating GraphQL APIs
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -31,9 +31,9 @@ Provides-Extra: quart
|
|
|
31
31
|
Provides-Extra: sanic
|
|
32
32
|
Requires-Dist: Django (>=3.2) ; extra == "django"
|
|
33
33
|
Requires-Dist: aiohttp (>=3.7.4.post0,<4) ; extra == "aiohttp"
|
|
34
|
-
Requires-Dist: asgiref (>=3.2
|
|
35
|
-
Requires-Dist: asgiref (>=3.2
|
|
36
|
-
Requires-Dist: chalice (>=1.22
|
|
34
|
+
Requires-Dist: asgiref (>=3.2) ; extra == "channels"
|
|
35
|
+
Requires-Dist: asgiref (>=3.2) ; extra == "django"
|
|
36
|
+
Requires-Dist: chalice (>=1.22) ; extra == "chalice"
|
|
37
37
|
Requires-Dist: channels (>=3.0.5) ; extra == "channels"
|
|
38
38
|
Requires-Dist: cross-web (>=0.4.0)
|
|
39
39
|
Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
|
|
@@ -47,8 +47,8 @@ Requires-Dist: opentelemetry-api (<2) ; extra == "opentelemetry"
|
|
|
47
47
|
Requires-Dist: opentelemetry-sdk (<2) ; extra == "opentelemetry"
|
|
48
48
|
Requires-Dist: packaging (>=23)
|
|
49
49
|
Requires-Dist: pydantic (>1.6.1) ; extra == "pydantic"
|
|
50
|
+
Requires-Dist: pygments (>=2.3) ; extra == "cli"
|
|
50
51
|
Requires-Dist: pygments (>=2.3) ; extra == "debug-server"
|
|
51
|
-
Requires-Dist: pygments (>=2.3,<3.0) ; extra == "cli"
|
|
52
52
|
Requires-Dist: pyinstrument (>=4.0.0) ; extra == "pyinstrument"
|
|
53
53
|
Requires-Dist: python-dateutil (>=2.7)
|
|
54
54
|
Requires-Dist: python-multipart (>=0.0.7) ; extra == "asgi"
|
|
@@ -189,7 +189,7 @@ strawberry/schema_codegen/__init__.py,sha256=HzgwI-rudoloXqJa5R9zyxXNTKLhdSXgSn7
|
|
|
189
189
|
strawberry/schema_directive.py,sha256=H5tv1npCkEa-mUkzQ9nilNI3zTGEAhyagRcDwj5Rujw,2025
|
|
190
190
|
strawberry/schema_directives.py,sha256=KGKFWCODjm1Ah9qNV_bBwbic7Mld4qLWnWQkev-PG8A,175
|
|
191
191
|
strawberry/static/apollo-sandbox.html,sha256=2XzkbE0dqsFHqehE-jul9_J9TFOpwA6Ylrlo0Kdx_9w,973
|
|
192
|
-
strawberry/static/graphiql.html,sha256=
|
|
192
|
+
strawberry/static/graphiql.html,sha256=czHhXGdLguz8k59237XKvWFIaMuUw91oe91nZ8fy6CI,6237
|
|
193
193
|
strawberry/static/pathfinder.html,sha256=0DPx9AmJ2C_sJstFXnWOz9k5tVQHeHaK7qdVY4lAlmk,1547
|
|
194
194
|
strawberry/streamable.py,sha256=8dqvKAv_Nhp8vEi4PUYyziCt3SUyCr6ZuqCNZ46Mqno,611
|
|
195
195
|
strawberry/subscriptions/__init__.py,sha256=1VGmiCzFepqRFyCikagkUoHHdoTG3XYlFu9GafoQMws,170
|
|
@@ -206,7 +206,7 @@ strawberry/tools/__init__.py,sha256=pdGpZx8wpq03VfUZJyF9JtYxZhGqzzxCiipsalWxJX4,
|
|
|
206
206
|
strawberry/tools/create_type.py,sha256=lYnqXMaecEWc0CtC2lGhX2mE--6S22q_V8GiIkHlGqw,2295
|
|
207
207
|
strawberry/tools/merge_types.py,sha256=hUMRRNM28FyPp70jRA3d4svv9WoEBjaNpihBt3DaY0I,1023
|
|
208
208
|
strawberry/types/__init__.py,sha256=baWEdDkkmCcITOhkg2hNUOenrNV1OYdxGE5qgvIRwwU,351
|
|
209
|
-
strawberry/types/arguments.py,sha256=
|
|
209
|
+
strawberry/types/arguments.py,sha256=3Rt1WlVDMc0KKYmJOnMUckeTB0egJv96Uw7RMopM4DM,11996
|
|
210
210
|
strawberry/types/auto.py,sha256=4sDflIg-Kz-QpK7Qo7bCSFblw7VE-0752rgayukFznU,2954
|
|
211
211
|
strawberry/types/base.py,sha256=Hubo7u6OsU1v1v-w-vBCwlNVTqHaNn4zPOJuX93WR5U,15699
|
|
212
212
|
strawberry/types/cast.py,sha256=fx86MkLW77GIximBAwUk5vZxSGwDqUA6XicXvz8EXwQ,916
|
|
@@ -238,8 +238,8 @@ strawberry/utils/logging.py,sha256=Dnivjd0ZhK_lAvjvuyCDkEWDhuURBoK9d3Kt_mIqbRg,7
|
|
|
238
238
|
strawberry/utils/operation.py,sha256=Qs3ttbuC415xEVqmJ6YsWQpJNUo8CZJq9AoMB-yV65w,1215
|
|
239
239
|
strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
|
|
240
240
|
strawberry/utils/typing.py,sha256=eE9NeMfASeXRstbjLnQFfOPymcSX8xwg3FGw_HCp95E,11828
|
|
241
|
-
strawberry_graphql-0.288.
|
|
242
|
-
strawberry_graphql-0.288.
|
|
243
|
-
strawberry_graphql-0.288.
|
|
244
|
-
strawberry_graphql-0.288.
|
|
245
|
-
strawberry_graphql-0.288.
|
|
241
|
+
strawberry_graphql-0.288.4.dist-info/METADATA,sha256=LiS09hr9ulZqpMfHbqvHv4rVtV7Ej_WIgApx4CQU-C0,7627
|
|
242
|
+
strawberry_graphql-0.288.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
243
|
+
strawberry_graphql-0.288.4.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
|
|
244
|
+
strawberry_graphql-0.288.4.dist-info/licenses/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
|
|
245
|
+
strawberry_graphql-0.288.4.dist-info/RECORD,,
|
|
File without changes
|
{strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{strawberry_graphql-0.288.2.dist-info → strawberry_graphql-0.288.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|