Skip to content

Commit ec513b9

Browse files
committed
Fix introspection and schema definition
1 parent 751bce3 commit ec513b9

File tree

7 files changed

+499
-191
lines changed

7 files changed

+499
-191
lines changed

juniper/src/executor_tests/introspection/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ async fn scalar_introspection() {
477477
name
478478
kind
479479
description
480-
specifiedByUrl
480+
specifiedByURL
481481
fields { name }
482482
interfaces { name }
483483
possibleTypes { name }
@@ -513,7 +513,7 @@ async fn scalar_introspection() {
513513
"name": "SampleScalar",
514514
"kind": "SCALAR",
515515
"description": null,
516-
"specifiedByUrl": null,
516+
"specifiedByURL": null,
517517
"fields": null,
518518
"interfaces": null,
519519
"possibleTypes": null,

juniper/src/schema/schema.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! GraphQL [Type System Definitions][0].
22
//!
3-
//! [0]: https://spec.graphql.org/September2025#sec-Appendix-Type-System-Definitions
3+
//! [0]:https://spec.graphql.org/September2025/#sec-Schema-Introspection.Schema-Introspection-Schema
44
55
use arcstr::ArcStr;
66

@@ -387,21 +387,21 @@ impl<'a, S: ScalarValue + 'a> TypeType<'a, S> {
387387
}
388388
}
389389

390-
fn is_one_of(&self) -> bool {
390+
fn is_one_of(&self) -> Option<bool> {
391391
match self {
392392
Self::Concrete(t) => match t {
393393
// TODO: Implement once `@oneOf` is implemented for input objects.
394-
MetaType::InputObject(InputObjectMeta { .. }) => todo!(),
394+
MetaType::InputObject(InputObjectMeta { .. }) => Some(false),
395395
MetaType::Enum(..)
396396
| MetaType::Interface(..)
397397
| MetaType::List(..)
398398
| MetaType::Nullable(..)
399399
| MetaType::Object(..)
400400
| MetaType::Placeholder(..)
401401
| MetaType::Scalar(..)
402-
| MetaType::Union(..) => false,
402+
| MetaType::Union(..) => None,
403403
},
404-
Self::List(..) | Self::NonNull(..) => false,
404+
Self::List(..) | Self::NonNull(..) => None,
405405
}
406406
}
407407
}

juniper/src/tests/introspection_tests.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ async fn test_builtin_introspection_query() {
289289
let result = crate::introspect(&schema, &database, IntrospectionFormat::default()).unwrap();
290290
let expected = schema_introspection_result();
291291

292-
assert_eq!(result, (expected, vec![]));
292+
assert_eq!(
293+
serde_json::to_string_pretty(&result.0).unwrap(),
294+
serde_json::to_string_pretty(&expected).unwrap(),
295+
);
293296
}
294297

295298
#[tokio::test]
@@ -305,5 +308,8 @@ async fn test_builtin_introspection_query_without_descriptions() {
305308
crate::introspect(&schema, &database, IntrospectionFormat::WithoutDescriptions).unwrap();
306309
let expected = schema_introspection_result_without_descriptions();
307310

308-
assert_eq!(result, (expected, vec![]));
311+
assert_eq!(
312+
serde_json::to_string_pretty(&result.0).unwrap(),
313+
serde_json::to_string_pretty(&expected).unwrap(),
314+
);
309315
}

0 commit comments

Comments
 (0)