Skip to content

Commit 83188d6

Browse files
committed
graphql: Remove unused functions
1 parent 448b649 commit 83188d6

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

graphql/src/schema/ast.rs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ impl ObjectType {
111111
}
112112
}
113113

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-
124114
/// Returns all type definitions in the schema.
125115
pub fn get_type_definitions(schema: &s::Document) -> Vec<&s::TypeDefinition> {
126116
schema
@@ -205,7 +195,7 @@ pub fn get_field_name(field_type: &s::Type) -> String {
205195
}
206196

207197
/// 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>(
209199
schema: &'a mut s::Document,
210200
name: &str,
211201
) -> Option<&'a mut s::TypeDefinition> {
@@ -238,18 +228,6 @@ pub fn get_type_name(t: &s::TypeDefinition) -> &str {
238228
}
239229
}
240230

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-
253231
/// Returns the argument definitions for a field of an object type.
254232
pub fn get_argument_definitions<'a>(
255233
object_type: impl Into<ObjectOrInterface<'a>>,
@@ -274,14 +252,6 @@ pub fn get_argument_definitions<'a>(
274252
}
275253
}
276254

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-
285255
/// Returns the type definition for a type.
286256
pub fn get_type_definition_from_type<'a>(
287257
schema: &'a s::Document,
@@ -386,17 +356,6 @@ pub fn get_referenced_entity_type<'a>(
386356
unpack_type(schema, &field.field_type).filter(|ty| is_entity_type_definition(ty))
387357
}
388358

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-
400359
/// If the field has a `@derivedFrom(field: "foo")` directive, obtain the
401360
/// name of the field (e.g. `"foo"`)
402361
pub fn get_derived_from_directive<'a>(field_definition: &s::Field) -> Option<&s::Directive> {

0 commit comments

Comments
 (0)