Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: drop check_identity from ExecutionSpec #1726

Closed
wants to merge 17 commits into from
Closed
12 changes: 11 additions & 1 deletion src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ use async_graphql::parser::types::*;
use async_graphql::{Pos, Positioned};
use async_graphql_value::{ConstValue, Name};

const NONEMPTY_DIRECTIVES: &[&str] = &["server", "upstream"];

fn print_directives(directives: &[Positioned<ConstDirective>]) -> String {
if directives.is_empty() {
return String::new();
}
directives
.iter()
.map(|d| print_directive(&const_directive_to_sdl(&d.node)))
.filter(|v| !v.is_empty())
.collect::<Vec<String>>()
.join(" ")
+ " "
Expand Down Expand Up @@ -213,7 +216,14 @@ fn print_directive(directive: &DirectiveDefinition) -> String {
.join(", ");

if args.is_empty() {
format!("@{}", directive.name.node)
if NONEMPTY_DIRECTIVES
.iter()
.any(|v| directive.name.node.eq(v))
{
String::new()
} else {
format!("@{}", directive.name.node)
}
ssddOnTop marked this conversation as resolved.
Show resolved Hide resolved
} else {
format!("@{}({})", directive.name.node, args)
}
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn run_blocking() -> anyhow::Result<()> {
.on_thread_stop(|| {
TRACING_GUARD.take();
})
.enable_all() // need this for any http IO before 2nd runtime is created
.build()?;
rt.block_on(async { tailcall::cli::run().await })
}
Expand Down
Loading