@@ -111,16 +111,6 @@ impl ObjectType {
111
111
}
112
112
}
113
113
114
- pub fn get_root_query_type_def ( schema : & s:: Document ) -> Option < & s:: TypeDefinition > {
115
- schema. definitions . iter ( ) . find_map ( |d| match d {
116
- s:: Definition :: TypeDefinition ( def @ s:: TypeDefinition :: Object ( _) ) => match def {
117
- s:: TypeDefinition :: Object ( t) if t. name == "Query" => Some ( def) ,
118
- _ => None ,
119
- } ,
120
- _ => None ,
121
- } )
122
- }
123
-
124
114
/// Returns all type definitions in the schema.
125
115
pub fn get_type_definitions ( schema : & s:: Document ) -> Vec < & s:: TypeDefinition > {
126
116
schema
@@ -205,7 +195,7 @@ pub fn get_field_name(field_type: &s::Type) -> String {
205
195
}
206
196
207
197
/// Returns a mutable version of the type with the given name.
208
- pub fn get_named_type_definition_mut < ' a > (
198
+ fn get_named_type_definition_mut < ' a > (
209
199
schema : & ' a mut s:: Document ,
210
200
name : & str ,
211
201
) -> Option < & ' a mut s:: TypeDefinition > {
@@ -238,18 +228,6 @@ pub fn get_type_name(t: &s::TypeDefinition) -> &str {
238
228
}
239
229
}
240
230
241
- /// Returns the description of a type.
242
- pub fn get_type_description ( t : & s:: TypeDefinition ) -> & Option < String > {
243
- match t {
244
- s:: TypeDefinition :: Enum ( t) => & t. description ,
245
- s:: TypeDefinition :: InputObject ( t) => & t. description ,
246
- s:: TypeDefinition :: Interface ( t) => & t. description ,
247
- s:: TypeDefinition :: Object ( t) => & t. description ,
248
- s:: TypeDefinition :: Scalar ( t) => & t. description ,
249
- s:: TypeDefinition :: Union ( t) => & t. description ,
250
- }
251
- }
252
-
253
231
/// Returns the argument definitions for a field of an object type.
254
232
pub fn get_argument_definitions < ' a > (
255
233
object_type : impl Into < ObjectOrInterface < ' a > > ,
@@ -274,14 +252,6 @@ pub fn get_argument_definitions<'a>(
274
252
}
275
253
}
276
254
277
- /// Returns the type definition that a field type corresponds to.
278
- pub fn get_type_definition_from_field < ' a > (
279
- schema : & ' a s:: Document ,
280
- field : & s:: Field ,
281
- ) -> Option < & ' a s:: TypeDefinition > {
282
- get_type_definition_from_type ( schema, & field. field_type )
283
- }
284
-
285
255
/// Returns the type definition for a type.
286
256
pub fn get_type_definition_from_type < ' a > (
287
257
schema : & ' a s:: Document ,
@@ -386,17 +356,6 @@ pub fn get_referenced_entity_type<'a>(
386
356
unpack_type ( schema, & field. field_type ) . filter ( |ty| is_entity_type_definition ( ty) )
387
357
}
388
358
389
- pub fn get_input_object_definitions ( schema : & s:: Document ) -> Vec < s:: InputObjectType > {
390
- schema
391
- . definitions
392
- . iter ( )
393
- . filter_map ( |d| match d {
394
- s:: Definition :: TypeDefinition ( s:: TypeDefinition :: InputObject ( t) ) => Some ( t. clone ( ) ) ,
395
- _ => None ,
396
- } )
397
- . collect ( )
398
- }
399
-
400
359
/// If the field has a `@derivedFrom(field: "foo")` directive, obtain the
401
360
/// name of the field (e.g. `"foo"`)
402
361
pub fn get_derived_from_directive < ' a > ( field_definition : & s:: Field ) -> Option < & s:: Directive > {
0 commit comments