Add descriptions for the exported Federation SDL.

This commit is contained in:
Sunli 2021-03-06 08:38:19 +08:00
parent 88232deb62
commit d723717e4b
2 changed files with 11 additions and 7 deletions

View File

@ -4,6 +4,10 @@ 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).
## [2.5.10] - 2021-03-06
- Add descriptions for the exported Federation SDL.
## [2.5.9] - 2021-02-28
### Changed

View File

@ -48,7 +48,7 @@ impl Registry {
continue;
}
if field.description.is_some() && !federation {
if field.description.is_some() {
writeln!(
sdl,
"\t\"\"\"\n\t{}\n\t\"\"\"",
@ -97,7 +97,7 @@ impl Registry {
export_scalar = false;
}
if export_scalar {
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
writeln!(sdl, "scalar {}", name).ok();
@ -122,7 +122,7 @@ impl Registry {
}
}
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
if federation && *extends {
@ -151,7 +151,7 @@ impl Registry {
description,
..
} => {
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
if federation && *extends {
@ -177,7 +177,7 @@ impl Registry {
description,
..
} => {
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
write!(sdl, "enum {} ", name).ok();
@ -193,7 +193,7 @@ impl Registry {
description,
..
} => {
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
write!(sdl, "input {} ", name).ok();
@ -212,7 +212,7 @@ impl Registry {
description,
..
} => {
if description.is_some() && !federation {
if description.is_some() {
writeln!(sdl, "\"\"\"\n{}\n\"\"\"", description.unwrap()).ok();
}
write!(sdl, "union {} =", name).ok();