11use std:: collections:: HashSet ;
22
3- use pretty_assertions:: assert_eq;
4-
53use super :: schema_introspection:: * ;
64use crate :: {
7- ScalarValue as _, graphql,
5+ ScalarValue as _, Value , graphql,
86 introspection:: IntrospectionFormat ,
97 schema:: model:: RootNode ,
108 tests:: fixtures:: starwars:: schema:: { Database , Query } ,
119 types:: scalars:: { EmptyMutation , EmptySubscription } ,
1210} ;
11+ use pretty_assertions:: assert_eq;
1312
1413#[ tokio:: test]
1514async fn test_introspection_query_type_name ( ) {
15+ // language=GraphQL
1616 let doc = r#"
1717 query IntrospectionQueryTypeQuery {
1818 __schema {
@@ -46,6 +46,7 @@ async fn test_introspection_query_type_name() {
4646
4747#[ tokio:: test]
4848async fn test_introspection_type_name ( ) {
49+ // language=GraphQL
4950 let doc = r#"
5051 query IntrospectionQueryTypeQuery {
5152 __type(name: "Droid") {
@@ -74,6 +75,7 @@ async fn test_introspection_type_name() {
7475
7576#[ tokio:: test]
7677async fn test_introspection_specific_object_type_name_and_kind ( ) {
78+ // language=GraphQL
7779 let doc = r#"
7880 query IntrospectionDroidKindQuery {
7981 __type(name: "Droid") {
@@ -105,6 +107,7 @@ async fn test_introspection_specific_object_type_name_and_kind() {
105107
106108#[ tokio:: test]
107109async fn test_introspection_specific_interface_type_name_and_kind ( ) {
110+ // language=GraphQL
108111 let doc = r#"
109112 query IntrospectionDroidKindQuery {
110113 __type(name: "Character") {
@@ -136,6 +139,7 @@ async fn test_introspection_specific_interface_type_name_and_kind() {
136139
137140#[ tokio:: test]
138141async fn test_introspection_documentation ( ) {
142+ // language=GraphQL
139143 let doc = r#"
140144 query IntrospectionDroidDescriptionQuery {
141145 __type(name: "Droid") {
@@ -167,6 +171,7 @@ async fn test_introspection_documentation() {
167171
168172#[ tokio:: test]
169173async fn test_introspection_directives ( ) {
174+ // language=GraphQL
170175 let q = r#"
171176 query IntrospectionQuery {
172177 __schema {
@@ -189,7 +194,7 @@ async fn test_introspection_directives() {
189194 . await
190195 . unwrap ( ) ;
191196
192- let expected = graphql_value ! ( {
197+ let expected: Value = graphql_value ! ( {
193198 "__schema" : {
194199 "directives" : [
195200 {
@@ -209,6 +214,12 @@ async fn test_introspection_directives() {
209214 "INLINE_FRAGMENT" ,
210215 ] ,
211216 } ,
217+ {
218+ "name" : "oneOf" ,
219+ "locations" : [
220+ "INPUT_OBJECT" ,
221+ ] ,
222+ } ,
212223 {
213224 "name" : "skip" ,
214225 "locations" : [
@@ -227,11 +238,15 @@ async fn test_introspection_directives() {
227238 } ,
228239 } ) ;
229240
230- assert_eq ! ( result, ( expected, vec![ ] ) ) ;
241+ assert_eq ! (
242+ serde_json:: to_string_pretty( & result. 0 ) . unwrap( ) ,
243+ serde_json:: to_string_pretty( & expected) . unwrap( ) ,
244+ ) ;
231245}
232246
233247#[ tokio:: test]
234248async fn test_introspection_possible_types ( ) {
249+ // language=GraphQL
235250 let doc = r#"
236251 query IntrospectionDroidDescriptionQuery {
237252 __type(name: "Character") {
0 commit comments