Merge pull request #1041 from k-kinzal/support-specified-by-directive

support @specifiedBy directive in SDL export
This commit is contained in:
Sunli 2022-08-29 13:49:32 +08:00 committed by GitHub
commit 895f3195be
1 changed files with 10 additions and 0 deletions

View File

@ -205,6 +205,7 @@ impl Registry {
description,
inaccessible,
tags,
specified_by_url,
..
} => {
let mut export_scalar = !SYSTEM_SCALARS.contains(&name.as_str());
@ -217,6 +218,15 @@ impl Registry {
}
write!(sdl, "scalar {}", name).ok();
if let Some(specified_by_url) = specified_by_url {
write!(
sdl,
" @specifiedBy(url: \"{}\")",
specified_by_url.replace('"', "\\\"")
)
.ok();
}
if options.federation {
if *inaccessible {
write!(sdl, " @inaccessible").ok();