Remove `SchemaBuilder::override_name` method. #437
This commit is contained in:
parent
067ee207cc
commit
662454c103
|
@ -2,7 +2,11 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
nd this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Remove `SchemaBuilder::override_name` method. [#437](https://github.com/async-graphql/async-graphql/issues/437)
|
||||
|
||||
## [2.7.1]
|
||||
|
||||
|
|
2
examples
2
examples
|
@ -1 +1 @@
|
|||
Subproject commit 5ed6f9829d3495ea9c182b08329c6026887dc551
|
||||
Subproject commit 4a5cfe2fc16061e8febd74b0e18f2d30b1cc07e5
|
|
@ -624,16 +624,4 @@ impl Registry {
|
|||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_name<T: Type>(&mut self, new_name: String) {
|
||||
match self.types.get_mut(&*T::type_name()) {
|
||||
Some(MetaType::Scalar { name, .. }) => *name = new_name,
|
||||
Some(MetaType::Object { name, .. }) => *name = new_name,
|
||||
Some(MetaType::Interface { name, .. }) => *name = new_name,
|
||||
Some(MetaType::Union { name, .. }) => *name = new_name,
|
||||
Some(MetaType::Enum { name, .. }) => *name = new_name,
|
||||
Some(MetaType::InputObject { name, .. }) => *name = new_name,
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,12 +119,6 @@ impl<Query, Mutation, Subscription> SchemaBuilder<Query, Mutation, Subscription>
|
|||
self
|
||||
}
|
||||
|
||||
/// Override the name of the specified type.
|
||||
pub fn override_name<T: Type>(mut self, new_name: impl Into<String>) -> Self {
|
||||
self.registry.set_name::<T>(new_name.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Build schema.
|
||||
pub fn finish(mut self) -> Schema<Query, Mutation, Subscription> {
|
||||
// federation
|
||||
|
|
Loading…
Reference in New Issue