Skip to content

Commit

Permalink
fix(jit): add field aliases and args support (#2709)
Browse files Browse the repository at this point in the history
Co-authored-by: Panagiotis Karatakis <[email protected]>
Co-authored-by: Panagiotis <[email protected]>
Co-authored-by: Kiryl Mialeshka <[email protected]>
  • Loading branch information
4 people authored Aug 26, 2024
1 parent d0f6a76 commit 9a50f13
Show file tree
Hide file tree
Showing 40 changed files with 212 additions and 98 deletions.
3 changes: 2 additions & 1 deletion src/core/blueprint/from_config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::collections::{BTreeMap, BTreeSet};

use async_graphql::dynamic::SchemaBuilder;
use indexmap::IndexMap;

use self::telemetry::to_opentelemetry;
use super::{Server, TypeLike};
Expand Down Expand Up @@ -70,7 +71,7 @@ pub fn apply_batching(mut blueprint: Blueprint) -> Blueprint {
pub fn to_json_schema_for_field(field: &Field, config: &Config) -> JsonSchema {
to_json_schema(field, config)
}
pub fn to_json_schema_for_args(args: &BTreeMap<String, Arg>, config: &Config) -> JsonSchema {
pub fn to_json_schema_for_args(args: &IndexMap<String, Arg>, config: &Config) -> JsonSchema {
let mut schema_fields = BTreeMap::new();
for (name, arg) in args.iter() {
schema_fields.insert(name.clone(), to_json_schema(arg, config));
Expand Down
6 changes: 4 additions & 2 deletions src/core/config/config.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::fmt::{self, Display};
use std::num::NonZeroU64;

use anyhow::Result;
use async_graphql::parser::types::{ConstDirective, ServiceDocument};
use async_graphql::Positioned;
use derive_setters::Setters;
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use tailcall_macros::{CustomResolver, DirectiveDefinition, InputDefinition};
Expand Down Expand Up @@ -254,7 +255,8 @@ pub struct Field {
///
/// Map of argument name and its definition.
#[serde(default, skip_serializing_if = "is_default")]
pub args: BTreeMap<String, Arg>,
#[schemars(with = "HashMap::<String, Arg>")]
pub args: IndexMap<String, Arg>,

///
/// Publicly visible documentation for the field.
Expand Down
9 changes: 5 additions & 4 deletions src/core/config/from_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use async_graphql::parser::types::{
use async_graphql::parser::Positioned;
use async_graphql::Name;
use async_graphql_value::ConstValue;
use indexmap::IndexMap;

use super::telemetry::Telemetry;
use super::Alias;
Expand Down Expand Up @@ -294,7 +295,7 @@ fn to_field(field_definition: &FieldDefinition) -> Valid<config::Field, String>
fn to_input_object_field(field_definition: &InputValueDefinition) -> Valid<config::Field, String> {
to_common_field(
field_definition,
BTreeMap::new(),
IndexMap::new(),
field_definition
.default_value
.as_ref()
Expand All @@ -303,7 +304,7 @@ fn to_input_object_field(field_definition: &InputValueDefinition) -> Valid<confi
}
fn to_common_field<F>(
field: &F,
args: BTreeMap<String, config::Arg>,
args: IndexMap<String, config::Arg>,
default_value: Option<ConstValue>,
) -> Valid<config::Field, String>
where
Expand Down Expand Up @@ -356,8 +357,8 @@ fn to_type_of(type_: &Type) -> String {
BaseType::List(ty) => to_type_of(ty),
}
}
fn to_args(field_definition: &FieldDefinition) -> BTreeMap<String, config::Arg> {
let mut args: BTreeMap<String, config::Arg> = BTreeMap::new();
fn to_args(field_definition: &FieldDefinition) -> IndexMap<String, config::Arg> {
let mut args = IndexMap::new();

for arg in field_definition.arguments.iter() {
let arg_name = pos_name_to_string(&arg.node.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ type NU {
}

type Query {
testVar0Var0(nnu: NNU__nu0, nu: NU__u0!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar0Var1(nnu: NNU__nu0, nu: NU__u1!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar0Var2(nnu: NNU__nu0, nu: NU__u2!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var0(nnu: NNU__nu1, nu: NU__u0!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var1(nnu: NNU__nu1, nu: NU__u1!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var2(nnu: NNU__nu1, nu: NU__u2!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var0(nnu: NNU__nu2, nu: NU__u0!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var1(nnu: NNU__nu2, nu: NU__u1!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var2(nnu: NNU__nu2, nu: NU__u2!): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar0Var0(nu: NU__u0!, nnu: NNU__nu0): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar0Var1(nu: NU__u0!, nnu: NNU__nu1): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar0Var2(nu: NU__u0!, nnu: NNU__nu2): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var0(nu: NU__u1!, nnu: NNU__nu0): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var1(nu: NU__u1!, nnu: NNU__nu1): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar1Var2(nu: NU__u1!, nnu: NNU__nu2): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var0(nu: NU__u2!, nnu: NNU__nu0): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var1(nu: NU__u2!, nnu: NNU__nu1): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
testVar2Var2(nu: NU__u2!, nnu: NNU__nu2): U @http(baseURL: "http://localhost", path: "/users/{{args.nu.u}}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ input T4 {
}

type Mutation {
addCart(addCartInput: T4, code: String): T2 @http(baseURL: "https://dummyjson.com", body: "{{.args.addCartInput}}", method: "POST", path: "/carts/add", query: [{key: "code", value: "{{.args.code}}"}])
addCart(code: String, addCartInput: T4): T2 @http(baseURL: "https://dummyjson.com", body: "{{.args.addCartInput}}", method: "POST", path: "/carts/add", query: [{key: "code", value: "{{.args.code}}"}])
}

type T1 {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ir/resolver_context_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl SelectionField {
fn from_jit_field(
field: &crate::core::jit::Field<Nested<ConstValue>, ConstValue>,
) -> SelectionField {
let name = field.name.clone();
let name = field.output_name.to_string();
let selection_set = field
.nested_iter(field.type_of.name())
.map(Self::from_jit_field)
Expand Down
27 changes: 21 additions & 6 deletions src/core/jit/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ impl Builder {
Some(Flat::new(id.clone())),
fragments,
);
let name = gql_field
.alias
.as_ref()
.map(|alias| alias.node.to_string())
.unwrap_or(field_name.to_string());
let ir = match field_def {
QueryField::Field((field_def, _)) => field_def.resolver.clone(),
_ => None,
};
let flat_field = Field {
id,
name,
name: field_name.to_string(),
output_name: gql_field
.alias
.as_ref()
.map(|a| a.node.to_string())
.unwrap_or(field_name.to_owned()),
ir,
type_of,
type_condition: type_condition.to_string(),
Expand Down Expand Up @@ -404,6 +404,21 @@ mod tests {
insta::assert_debug_snapshot!(plan.into_nested());
}

#[test]
fn test_alias_query() {
let plan = plan(
r#"
query {
articles: posts { author: user { identifier: id } }
}
"#,
&Variables::new(),
);

assert!(plan.is_query());
insta::assert_debug_snapshot!(plan.into_nested());
}

#[test]
fn test_simple_mutation() {
let plan = plan(
Expand Down
39 changes: 26 additions & 13 deletions src/core/jit/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::sync::{Arc, Mutex, MutexGuard};

use async_graphql::{Name, ServerError};
use async_graphql_value::ConstValue;
use indexmap::IndexMap;

use super::error::*;
use super::{Field, Nested, OperationPlan, Positioned};
Expand Down Expand Up @@ -39,28 +40,20 @@ pub struct Context<'a, Input, Output> {
request: &'a RequestContext<Input>,
}
impl<'a, Input: Clone, Output> Context<'a, Input, Output> {
pub fn new(field: &'a Field<Nested<Input>, Input>, env: &'a RequestContext<Input>) -> Self {
Self { value: None, args: None, field, request: env }
pub fn new(field: &'a Field<Nested<Input>, Input>, request: &'a RequestContext<Input>) -> Self {
Self { request, value: None, args: Self::build_args(field), field }
}

pub fn with_value_and_field(
&self,
value: &'a Output,
field: &'a Field<Nested<Input>, Input>,
) -> Self {
Self { args: None, value: Some(value), field, request: self.request }
}

pub fn with_args(&self, args: indexmap::IndexMap<&str, Input>) -> Self {
let mut map = indexmap::IndexMap::new();
for (key, value) in args {
map.insert(Name::new(key), value);
}
Self {
value: self.value,
args: Some(map),
field: self.field,
request: self.request,
args: Self::build_args(field),
value: Some(value),
field,
}
}

Expand All @@ -71,6 +64,26 @@ impl<'a, Input: Clone, Output> Context<'a, Input, Output> {
pub fn field(&self) -> &Field<Nested<Input>, Input> {
self.field
}

fn build_args(field: &Field<Nested<Input>, Input>) -> Option<IndexMap<Name, Input>> {
let mut arg_map = IndexMap::new();

for arg in field.args.iter() {
let name = arg.name.as_str();
let value = arg
.value
.clone()
// TODO: default value resolution should happen in the InputResolver
.or_else(|| arg.default_value.clone());
if let Some(value) = value {
arg_map.insert(Name::new(name), value);
} else if !arg.type_of.is_nullable() {
// TODO: throw error here
todo!()
}
}
Some(arg_map)
}
}

impl<'a> ResolverContextLike for Context<'a, ConstValue, ConstValue> {
Expand Down
2 changes: 1 addition & 1 deletion src/core/jit/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum ValidationError {
// TODO: replace with sane error message. Right now, it's defined as is only for compatibility
// with async_graphql error message for this case
#[error(r#"internal: invalid value for scalar "{type_of}", expected "FieldValue::Value""#)]
ScalarInvalid { type_of: String, path: String },
ScalarInvalid { type_of: String },
#[error("TypeName shape doesn't satisfy the processed object")]
TypeNameMismatch,
#[error(r#"internal: invalid item for enum "{type_of}""#)]
Expand Down
22 changes: 3 additions & 19 deletions src/core/jit/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ where
Exec: IRExecutor<Input = Input, Output = Output, Error = jit::Error>,
{
pub fn new(plan: OperationPlan<Input>, exec: Exec) -> Self {
Self { exec, ctx: RequestContext::new(plan) }
Self { exec, ctx: RequestContext::new(plan.clone()) }
}

pub async fn store(&self) -> Store<Result<TypedValue<Output>, Positioned<jit::Error>>> {
Expand Down Expand Up @@ -73,25 +73,9 @@ where

async fn init(&mut self) {
join_all(self.request.plan().as_nested().iter().map(|field| async {
let mut arg_map = indexmap::IndexMap::new();
for arg in field.args.iter() {
let name = arg.name.as_str();
let value: Option<Input> = arg
.value
.clone()
// TODO: default value resolution should happen in the InputResolver
.or_else(|| arg.default_value.clone());

if let Some(value) = value {
arg_map.insert(name, value);
} else if !arg.type_of.is_nullable() {
// TODO: throw error here
todo!()
}
}
let ctx = Context::new(field, self.request);
// TODO: with_args should be called on inside iter_field on any level, not only
// for root fields
let ctx = Context::new(field, self.request).with_args(arg_map);
self.execute(&ctx, DataPath::new()).await
}))
.await;
Expand Down Expand Up @@ -176,7 +160,7 @@ where
let default_obj = Output::object(Output::JsonObject::new());
let value = ctx
.value()
.and_then(|v| v.get_key(&field.name))
.and_then(|v| v.get_key(&field.output_name))
// in case there is no value we still put some dumb empty value anyway
// to force execution of the nested fields even when parent object is not present.
// For async_graphql it's done by `fix_dangling_resolvers` fn that basically creates
Expand Down
9 changes: 9 additions & 0 deletions src/core/jit/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ impl FieldId {
#[derive(Clone)]
pub struct Field<Extensions, Input> {
pub id: FieldId,
/// Name of key in the value object for this field
pub name: String,
/// Output name (i.e. with alias) that should be used for the result value
/// of this field
pub output_name: String,
pub ir: Option<IR>,
pub type_of: crate::core::blueprint::Type,
/// Specifies the name of type used in condition to fetch that field
Expand Down Expand Up @@ -158,6 +162,7 @@ impl<Input> Field<Nested<Input>, Input> {
Ok(Field {
id: self.id,
name: self.name,
output_name: self.output_name,
ir: self.ir,
type_of: self.type_of,
type_condition: self.type_condition,
Expand Down Expand Up @@ -187,6 +192,7 @@ impl<Input> Field<Flat, Input> {
Ok(Field {
id: self.id,
name: self.name,
output_name: self.output_name,
ir: self.ir,
type_of: self.type_of,
type_condition: self.type_condition,
Expand Down Expand Up @@ -262,6 +268,7 @@ impl<Input> Field<Flat, Input> {
Field {
id: self.id,
name: self.name,
output_name: self.output_name,
ir: self.ir,
type_of: self.type_of,
type_condition: self.type_condition,
Expand All @@ -280,6 +287,7 @@ impl<Extensions: Debug, Input: Debug> Debug for Field<Extensions, Input> {
let mut debug_struct = f.debug_struct("Field");
debug_struct.field("id", &self.id);
debug_struct.field("name", &self.name);
debug_struct.field("output_name", &self.output_name);
if self.ir.is_some() {
debug_struct.field("ir", &"Some(..)");
}
Expand All @@ -298,6 +306,7 @@ impl<Extensions: Debug, Input: Debug> Debug for Field<Extensions, Input> {
debug_struct.field("include", &self.include);
}
debug_struct.field("directives", &self.directives);

debug_struct.finish()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
source: src/core/jit/builder.rs
expression: plan.into_nested()
---
[
Field {
id: 0,
name: "posts",
output_name: "articles",
ir: "Some(..)",
type_of: [Post],
type_condition: "Query",
extensions: Some(
Nested(
[
Field {
id: 1,
name: "user",
output_name: "author",
ir: "Some(..)",
type_of: User,
type_condition: "Post",
extensions: Some(
Nested(
[
Field {
id: 2,
name: "id",
output_name: "identifier",
type_of: ID!,
type_condition: "User",
directives: [],
},
],
),
),
directives: [],
},
],
),
),
directives: [],
},
]
Loading

2 comments on commit 9a50f13

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running 268 tests
test run_execution_spec::add-field-index-list.md ... ok
test run_execution_spec::add-field-many-list.md ... ok
test run_execution_spec::add-field-many.md ... ok
test run_execution_spec::add-field-modify.md ... ok
test run_execution_spec::add-field-with-composition.md ... ok
test run_execution_spec::add-field-with-modify.md ... ok
test run_execution_spec::add-field.md ... ok
test run_execution_spec::apollo-tracing.md ... ok
test run_execution_spec::async-cache-disabled.md ... ok
test run_execution_spec::async-cache-enable-multiple-resolvers.md ... ok
test run_execution_spec::async-cache-enabled.md ... ok
test run_execution_spec::async-cache-global.md ... ok
test run_execution_spec::async-cache-inflight-request.md ... ok
test run_execution_spec::auth-protected-without-auth.md ... ok
test run_execution_spec::auth-jwt.md ... ok
test run_execution_spec::auth-basic.md ... ok
test run_execution_spec::auth.md ... ok
test run_execution_spec::batching-disabled.md ... ok
test run_execution_spec::batching-default.md ... ok
test run_execution_spec::batching-group-by-default.md ... ok
test run_execution_spec::batching-group-by-optional-key.md ... ok
test run_execution_spec::batching-group-by.md ... ok
test run_execution_spec::batching-post.md ... ok
test run_execution_spec::batching.md ... ok
test run_execution_spec::cache-control.md ... ok
test run_execution_spec::caching-collision.md ... ok
test run_execution_spec::call-graphql-datasource.md ... ok
test run_execution_spec::caching.md ... ok
test run_execution_spec::call-multiple-steps-piping.md ... ok
test run_execution_spec::call-mutation.md ... ok
test run_execution_spec::call-operator.md ... ok
test run_execution_spec::cors-allow-cred-false.md ... ok
test run_execution_spec::cors-invalid-expose-headers.md ... ok
test run_execution_spec::cors-invalid-headers.md ... ok
test run_execution_spec::cors-invalid-methods.md ... ok
test run_execution_spec::cors-invalid-origins.md ... ok
test run_execution_spec::cors-allow-cred-true.md ... ok
test run_execution_spec::cors-allow-cred-vary.md ... ok
test run_execution_spec::custom-headers.md ... ok
test run_execution_spec::dedupe_batch_query_execution.md ... ok
test run_execution_spec::default-value-arg.md ... ok
test run_execution_spec::experimental-headers-error.md ... ok
test run_execution_spec::default-value-config.md ... ok
test run_execution_spec::env-value.md ... ok
test run_execution_spec::graphql-conformance-002.md ... ok
test run_execution_spec::experimental-headers.md ... ok
test run_execution_spec::graphql-conformance-004.md ... ok
test run_execution_spec::graphql-conformance-005.md ... ok
test run_execution_spec::graphql-conformance-006.md ... ok
test run_execution_spec::graphql-conformance-007.md ... ok
test run_execution_spec::graphql-conformance-008.md ... ok
test run_execution_spec::graphql-conformance-009.md ... ok
test run_execution_spec::graphql-conformance-001.md ... ok
test run_execution_spec::graphql-conformance-011.md ... ok
test run_execution_spec::graphql-conformance-012.md ... ok
test run_execution_spec::graphql-conformance-003.md ... ok
test run_execution_spec::graphql-conformance-010.md ... ok
test run_execution_spec::graphql-conformance-014.md ... ok
test run_execution_spec::graphql-conformance-016.md ... ok
test run_execution_spec::graphql-conformance-017.md ... ok
test run_execution_spec::graphql-conformance-013.md ... FAILED
test run_execution_spec::graphql-conformance-015.md ... ok
test run_execution_spec::graphql-conformance-http-001.md ... ok
test run_execution_spec::graphql-conformance-http-002.md ... ok
test run_execution_spec::graphql-conformance-http-003.md ... ok
test run_execution_spec::graphql-conformance-http-004.md ... ok
test run_execution_spec::graphql-conformance-http-007.md ... ok
test run_execution_spec::graphql-conformance-http-008.md ... ok
test run_execution_spec::graphql-conformance-http-009.md ... ok
test run_execution_spec::graphql-conformance-http-005.md ... ok
test run_execution_spec::graphql-conformance-http-011.md ... ok
test run_execution_spec::graphql-conformance-http-006.md ... ok
test run_execution_spec::graphql-conformance-http-010.md ... ok
test run_execution_spec::graphql-conformance-http-012.md ... ok
test run_execution_spec::graphql-conformance-http-013.md ... FAILED
test run_execution_spec::graphql-conformance-http-016.md ... ok
test run_execution_spec::graphql-conformance-http-017.md ... ok
test run_execution_spec::graphql-conformance-http-014.md ... ok
test run_execution_spec::graphql-conformance-http-015.md ... ok
test run_execution_spec::graphql-dataloader-batch-request.md ... ok
test run_execution_spec::graphql-datasource-errors.md ... ok
test run_execution_spec::graphql-dataloader-no-batch-request.md ... ok
test run_execution_spec::graphql-datasource-no-args.md ... ok
test run_execution_spec::graphql-datasource-mutation.md ... ok
test run_execution_spec::graphql-datasource-query-directives.md ... ok
test run_execution_spec::graphql-datasource-with-empty-enum.md ... ok
test run_execution_spec::graphql-datasource-with-args.md ... ok
test run_execution_spec::graphql-datasource-with-mandatory-enum.md ... ok
test run_execution_spec::graphql-nested-datasource.md ... ok
test run_execution_spec::grpc-batch.md ... ok
test run_execution_spec::grpc-error.md ... ok
test run_execution_spec::grpc-json.md ... ok
test run_execution_spec::grpc-map.md ... ok
test run_execution_spec::grpc-oneof.md ... FAILED
test run_execution_spec::grpc-proto-with-same-package.md ... ok
test run_execution_spec::grpc-override-url-from-upstream.md ... ok
test run_execution_spec::grpc-reflection.md ... ok
test run_execution_spec::grpc-simple.md ... ok
test run_execution_spec::grpc-url-from-upstream.md ... ok
test run_execution_spec::https.md ... ok
test run_execution_spec::inline-field.md ... ok
test run_execution_spec::inline-index-list.md ... ok
test run_execution_spec::input-type-protected-error.md ... ok
test run_execution_spec::inline-many-list.md ... ok
test run_execution_spec::io-cache.md ... ok
test run_execution_spec::inline-many.md ... ok
test run_execution_spec::js-directive.md ... ok
test run_execution_spec::modified-field.md ... ok
test run_execution_spec::mutation-put.md ... ok
test run_execution_spec::mutation.md ... ok
test run_execution_spec::n-plus-one-list.md ... ok
test run_execution_spec::jsonplaceholder-call-post.md ... ok
test run_execution_spec::n-plus-one.md ... ok
test run_execution_spec::nested-objects.md ... ok
test run_execution_spec::nested-recursive-types.md ... ok
test run_execution_spec::nesting-level3.md ... ok
test run_execution_spec::nullable-arg-query.md ... ok
test run_execution_spec::omit-index-list.md ... ok
test run_execution_spec::predefined-scalar.md ... ok
test run_execution_spec::omit-resolved-by-parent.md ... ok
test run_execution_spec::recursive-types-no-resolver.md ... ok
test run_execution_spec::recursive-types-json.md ... ok
test run_execution_spec::omit-many.md ... ok
test run_execution_spec::recursive-types.md ... ok
test run_execution_spec::ref-other-nested.md ... ok
test run_execution_spec::ref-other.md ... ok
test run_execution_spec::related-fields-recursive.md ... ok
test run_execution_spec::rename-field.md ... ok
test run_execution_spec::request-to-upstream-batching.md ... ok
test run_execution_spec::resolve-with-headers.md ... ok
test run_execution_spec::resolve-with-vars.md ... ok
test run_execution_spec::resolved-by-parent.md ... ok
test run_execution_spec::rest-api-error.md ... ok
test run_execution_spec::rest-api-post.md ... ok
test run_execution_spec::rest-api.md ... ok
test run_execution_spec::showcase.md ... ok
test run_execution_spec::test-add-field-error.md ... ok
test run_execution_spec::simple-graphql.md ... ok
test run_execution_spec::simple-query.md ... ok
test run_execution_spec::test-add-field-list.md ... ok
test run_execution_spec::test-all-blueprint-errors.md ... ok
test run_execution_spec::test-batch-operator-post.md ... ok
test run_execution_spec::test-add-link-to-empty-config.md ... ok
test run_execution_spec::test-add-field.md ... ok
test run_execution_spec::test-call-operator-errors.md ... ok
test run_execution_spec::test-conflict-allowed-headers.md ... ok
test run_execution_spec::test-conflict-vars.md ... ok
test run_execution_spec::test-batching-group-by.md ... ok
test run_execution_spec::test-cache.md ... ok
test run_execution_spec::test-dbl-usage-many.md ... ok
test run_execution_spec::test-custom-scalar.md ... ok
test run_execution_spec::test-directives-undef-null-fields.md ... ok
test run_execution_spec::test-duplicated-link.md ... ok
test run_execution_spec::test-empty-link.md ... ok
test run_execution_spec::test-custom-types.md ... ok
test run_execution_spec::test-enable-jit.md ... ok
test run_execution_spec::test-description-many.md ... ok
test run_execution_spec::test-enum-default.md ... ok
test run_execution_spec::test-enum-empty.md ... ok
test run_execution_spec::test-enum-merge.md ... ok
test run_execution_spec::test-enum-aliases.md ... ok
test run_execution_spec::test-expr-error.md ... ok
test run_execution_spec::test-expr-scalar-as-string.md ... ok
test run_execution_spec::test-expr-with-add-field.md ... ok
test run_execution_spec::test-expr-with-inline.md ... ok
test run_execution_spec::test-enum-description.md ... ok
test run_execution_spec::test-enum.md ... ok
test run_execution_spec::test-field-already-implemented-from-Interface.md ... ok
test run_execution_spec::test-graphql-with-add-field.md ... ok
test run_execution_spec::test-graphqlsource-no-base-url.md ... ok
test run_execution_spec::test-expr-with-mustache.md ... ok
test run_execution_spec::test-groupby-without-batching.md ... ok
test run_execution_spec::test-grpc-group-by.md ... ok
test run_execution_spec::test-grpc-invalid-method-format.md ... ok
test run_execution_spec::test-grpc-invalid-proto-id.md ... ok
test run_execution_spec::test-grpc-missing-fields.md ... ok
test run_execution_spec::test-grpc-nested-data.md ... ok
test run_execution_spec::test-grpc-nested-optional.md ... ok
test run_execution_spec::test-grpc-optional.md ... ok
test run_execution_spec::test-grpc-proto-path.md ... ok
test run_execution_spec::test-grpc-service-method.md ... ok
test run_execution_spec::test-grpc-service.md ... ok
test run_execution_spec::test-expr.md ... ok
test run_execution_spec::test-hostname-faliure.md ... ok
test run_execution_spec::test-graphqlsource.md ... ok
test run_execution_spec::test-grpc.md ... ok
test run_execution_spec::test-http-baseurl.md ... ok
test run_execution_spec::test-http-batchKey.md ... ok
test run_execution_spec::test-http-with-add-field.md ... ok
test run_execution_spec::test-http-with-inline.md ... ok
test run_execution_spec::test-http-headers.md ... ok
test run_execution_spec::test-http-with-mustache-expr.md ... ok
test run_execution_spec::test-inline-error.md ... ok
test run_execution_spec::test-http-tmpl.md ... ok
test run_execution_spec::test-http.md ... ok
test run_execution_spec::test-inline-list.md ... ok
test run_execution_spec::test-inline.md ... ok
test run_execution_spec::test-input-out.md ... ok
test run_execution_spec::test-input-documentation.md ... ok
test run_execution_spec::test-input-with-arg-out.md ... ok
test run_execution_spec::test-interface-from-json.md ... ok
test run_execution_spec::test-invalid-query-in-http.md ... ok
test run_execution_spec::test-invalid-server.md ... ok
test run_execution_spec::test-js-multi-onRequest-handlers.md ... ok
test run_execution_spec::test-js-multiple-scripts.md ... ok
test run_execution_spec::test-interface-result.md ... ok
test run_execution_spec::test-interface.md ... ok
test run_execution_spec::test-lack-resolver.md ... ok
test run_execution_spec::test-js-request-response-2.md ... ok
test run_execution_spec::test-js-request-response.md ... ok
test run_execution_spec::test-merge-batch.md ... ok
test run_execution_spec::test-list-args.md ... ok
test run_execution_spec::test-merge-query.md ... ok
test run_execution_spec::test-merge-nested.md ... ok
test run_execution_spec::test-merge-union.md ... ok
test run_execution_spec::test-missing-argument-on-all-resolvers.md ... ok
test run_execution_spec::test-missing-mutation-resolver.md ... ok
test run_execution_spec::test-missing-query-resolver.md ... ok
test run_execution_spec::test-missing-root-types.md ... ok
test run_execution_spec::test-missing-schema-query.md ... ok
test run_execution_spec::test-merge-right-with-link-config.md ... ok
test run_execution_spec::test-merge-server-sdl.md ... ok
test run_execution_spec::test-multiple-config-types.md ... ok
test run_execution_spec::test-multiple-resolvable-directives-on-field.md ... ok
test run_execution_spec::test-modify.md ... ok
test run_execution_spec::test-multi-interface.md ... ok
test run_execution_spec::test-nested-input.md ... ok
test run_execution_spec::test-no-base-url.md ... ok
test run_execution_spec::test-nested-link.md ... ok
test run_execution_spec::test-nested-value.md ... ok
test run_execution_spec::test-null-in-array.md ... ok
test run_execution_spec::test-null-in-object.md ... ok
test run_execution_spec::test-optional-key-skip-empty.md ... ok
test run_execution_spec::test-omit-list.md ... ok
test run_execution_spec::test-omit.md ... ok
test run_execution_spec::test-params-as-body.md ... ok
test run_execution_spec::test-query-documentation.md ... ok
test run_execution_spec::test-query.md ... ok
test run_execution_spec::test-response-header-value.md ... ok
test run_execution_spec::test-response-headers-multi.md ... ok
test run_execution_spec::test-response-headers-name.md ... ok
test run_execution_spec::test-response-header-merge.md ... ok
test run_execution_spec::test-ref-other.md ... ok
test run_execution_spec::test-scalars-builtin.md ... ok
test run_execution_spec::test-scalars-integers.md ... ok
test run_execution_spec::test-scalars-validation.md ... ok
test run_execution_spec::test-server-base-types.md ... ok
test run_execution_spec::test-set-cookie-headers.md ... ok
test run_execution_spec::test-server-vars.md ... ok
test run_execution_spec::test-undefined-query.md ... ok
test run_execution_spec::test-static-value.md ... ok
test run_execution_spec::test-union-many-types.md ... ok
test run_execution_spec::test-union-same-types.md ... ok
test run_execution_spec::test-union-ambiguous.md ... ok
test run_execution_spec::test-scalars.md ... ok
test run_execution_spec::test-upstream-headers.md ... ok
test run_execution_spec::undeclared-type-no-base-url.md ... ok
test run_execution_spec::undeclared-type.md ... ok
test run_execution_spec::test-union.md ... FAILED
test run_execution_spec::upstream-batching.md ... ok
test run_execution_spec::test-upstream.md ... ok
test run_execution_spec::upstream-fail-request.md ... ok
test run_execution_spec::with-args-url.md ... ok
test run_execution_spec::with-args.md ... ok
test run_execution_spec::with-nesting.md ... ok
test run_execution_spec::yaml-nested-unions.md ... ok
test run_execution_spec::yaml-union-in-type.md ... ok
test run_execution_spec::yaml-union.md ... ok

failures:

---- run_execution_spec::graphql-conformance-013.md ----
test panicked: snapshot assertion for 'graphql-conformance-013.md_0' failed in line 202

---- run_execution_spec::graphql-conformance-http-013.md ----
test panicked: snapshot assertion for 'graphql-conformance-http-013.md_0' failed in line 202

---- run_execution_spec::grpc-oneof.md ----
test panicked: snapshot assertion for 'grpc-oneof.md_0' failed in line 202

---- run_execution_spec::test-union.md ----
test panicked: snapshot assertion for 'test-union.md_4' failed in line 202

failures:
run_execution_spec::graphql-conformance-013.md
run_execution_spec::graphql-conformance-http-013.md
run_execution_spec::grpc-oneof.md
run_execution_spec::test-union.md

test result: FAILED. 264 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 14.34s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 7.35ms 3.23ms 82.35ms 71.42%
Req/Sec 3.44k 180.38 3.87k 92.00%

410276 requests in 30.00s, 2.06GB read

Requests/sec: 13673.82

Transfer/sec: 70.18MB

Please sign in to comment.