Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit06c85f3

Browse files
committed
dynamic: fixed__typename always returnednull when introspection was disabled.
1 parent60e353e commit06c85f3

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

‎CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on[Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
#[7.0.16] 2025-03-20
8+
9+
- dynamic: fixed`__typename` always returned`null` when introspection was disabled.
10+
711
#[7.0.15] 2025-02-03
812

913
- feat: Add`custom-error-conversion` feature[#1631](https://github.com/async-graphql/async-graphql/pull/1631)

‎src/dynamic/resolve.rs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,17 @@ pub(crate) async fn resolve_container(
5252
fncollect_typename_field<'a>(
5353
fields:&mutVec<BoxFieldFuture<'a>>,
5454
object:&'aObject,
55-
ctx:&ContextSelectionSet<'a>,
5655
field:&'aPositioned<Field>,
5756
){
58-
ifmatches!(
59-
ctx.schema_env.registry.introspection_mode,
60-
IntrospectionMode::Enabled |IntrospectionMode::IntrospectionOnly
61-
) &&matches!(
62-
ctx.query_env.introspection_mode,
63-
IntrospectionMode::Enabled |IntrospectionMode::IntrospectionOnly,
64-
){
65-
fields.push(
66-
asyncmove{
67-
Ok((
68-
field.node.response_key().node.clone(),
69-
Value::from(object.name.as_str()),
70-
))
71-
}
72-
.boxed(),
73-
)
74-
}else{
75-
fields
76-
.push(asyncmove{Ok((field.node.response_key().node.clone(),Value::Null))}.boxed())
77-
}
57+
fields.push(
58+
asyncmove{
59+
Ok((
60+
field.node.response_key().node.clone(),
61+
Value::from(object.name.as_str()),
62+
))
63+
}
64+
.boxed(),
65+
)
7866
}
7967

8068
fncollect_schema_field<'a>(
@@ -308,7 +296,7 @@ fn collect_fields<'a>(
308296
match&selection.node{
309297
Selection::Field(field) =>{
310298
if field.node.name.node =="__typename"{
311-
collect_typename_field(fields, object,ctx,field);
299+
collect_typename_field(fields, object, field);
312300
continue;
313301
}
314302

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp