diff --git a/Cargo.lock b/Cargo.lock index 050784bfaf..6a88c7fc64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -802,6 +802,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bf2a5fb3207c12b5d208ebc145f967fea5cac41a021c37417ccc31ba40f39ee" +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" + [[package]] name = "cast" version = "0.3.0" @@ -1257,6 +1263,18 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "datatest-stable" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00bbc70e3e6ab07f612f92eae3b282e30bcd0e093df2a9febf9db99799066fe" +dependencies = [ + "camino", + "fancy-regex", + "libtest-mimic", + "walkdir", +] + [[package]] name = "debugid" version = "0.8.0" @@ -1498,6 +1516,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "escape8259" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee" +dependencies = [ + "rustversion", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -1573,6 +1600,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fancy-regex" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +dependencies = [ + "bit-set", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + [[package]] name = "fast_chemail" version = "0.9.6" @@ -2820,6 +2858,18 @@ dependencies = [ "libc", ] +[[package]] +name = "libtest-mimic" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fefdf21230d6143476a28adbee3d930e2b68a3d56443c777cae3fe9340eebff9" +dependencies = [ + "clap", + "escape8259", + "termcolor", + "threadpool", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -5127,6 +5177,7 @@ dependencies = [ "colored", "convert_case", "criterion", + "datatest-stable", "deno_core", "derive_setters", "dotenvy", @@ -5196,6 +5247,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tokio-test", "tonic", "tonic-types", "tracing", @@ -5381,6 +5433,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.59" @@ -5411,6 +5472,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.36" @@ -5548,6 +5618,19 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-test" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" +dependencies = [ + "async-stream", + "bytes", + "futures-core", + "tokio", + "tokio-stream", +] + [[package]] name = "tokio-util" version = "0.7.10" diff --git a/Cargo.toml b/Cargo.toml index 0057603986..6d9000cc2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,6 +146,8 @@ convert_case = "0.6.0" rand = "0.8.5" tailcall-macros = { path = "tailcall-macros" } tonic-types = "0.11.0" +datatest-stable = "0.2.7" +tokio-test = "0.4.4" [dev-dependencies] @@ -244,3 +246,8 @@ harness = false [[bench]] name = "protobuf_convert_output" harness = false + +[[test]] +name = "execution_spec" +harness = false + diff --git a/tests/core/env.rs b/tests/core/env.rs new file mode 100644 index 0000000000..51f099372b --- /dev/null +++ b/tests/core/env.rs @@ -0,0 +1,23 @@ +extern crate core; + +use std::borrow::Cow; +use std::collections::HashMap; + +use tailcall::EnvIO; + +#[derive(Clone)] +pub struct Env { + vars: HashMap, +} + +impl EnvIO for Env { + fn get(&self, key: &str) -> Option> { + self.vars.get(key).map(Cow::from) + } +} + +impl Env { + pub fn init(vars: Option>) -> Self { + Self { vars: vars.unwrap_or_default() } + } +} diff --git a/tests/core/file.rs b/tests/core/file.rs new file mode 100644 index 0000000000..e784ed306c --- /dev/null +++ b/tests/core/file.rs @@ -0,0 +1,67 @@ +extern crate core; + +use std::path::PathBuf; + +use anyhow::{anyhow, Context}; +use tailcall::FileIO; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; + +use super::runtime::ExecutionSpec; +pub struct File { + spec: ExecutionSpec, +} + +impl File { + pub fn new(spec: ExecutionSpec) -> File { + File { spec } + } +} + +#[async_trait::async_trait] +impl FileIO for File { + async fn write<'a>(&'a self, _path: &'a str, _content: &'a [u8]) -> anyhow::Result<()> { + Err(anyhow!("Cannot write to a file in an execution spec")) + } + + async fn read<'a>(&'a self, path: &'a str) -> anyhow::Result { + let base = PathBuf::from(path); + let path = base + .file_name() + .context("Invalid file path")? + .to_str() + .context("Invalid OsString")?; + match self.spec.files.get(path) { + Some(x) => Ok(x.to_owned()), + None => Err(anyhow!("No such file or directory (os error 2)")), + } + } +} + +#[derive(Clone)] +pub struct TestFileIO {} + +impl TestFileIO { + pub fn init() -> Self { + TestFileIO {} + } +} + +#[async_trait::async_trait] +impl FileIO for TestFileIO { + async fn write<'a>(&'a self, path: &'a str, content: &'a [u8]) -> anyhow::Result<()> { + let mut file = tokio::fs::File::create(path).await?; + file.write_all(content) + .await + .map_err(|e| anyhow!("{}", e))?; + Ok(()) + } + + async fn read<'a>(&'a self, path: &'a str) -> anyhow::Result { + let mut file = tokio::fs::File::open(path).await?; + let mut buffer = Vec::new(); + file.read_to_end(&mut buffer) + .await + .map_err(|e| anyhow!("{}", e))?; + Ok(String::from_utf8(buffer)?) + } +} diff --git a/tests/core/http.rs b/tests/core/http.rs new file mode 100644 index 0000000000..2a0d13a594 --- /dev/null +++ b/tests/core/http.rs @@ -0,0 +1,176 @@ +extern crate core; + +use std::panic; +use std::path::Path; +use std::str::FromStr; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; + +use anyhow::anyhow; +use hyper::body::Bytes; +use reqwest::header::{HeaderName, HeaderValue}; +use serde_json::Value; +use tailcall::http::Response; +use tailcall::HttpIO; + +use super::runtime::{ExecutionMock, ExecutionSpec}; + +#[derive(Clone, Debug)] +pub struct Http { + mocks: Vec, + spec_path: String, +} + +impl Http { + pub fn new(spec: &ExecutionSpec) -> Self { + let mocks = spec + .mock + .as_ref() + .map(|mocks| { + mocks + .iter() + .map(|mock| ExecutionMock { + mock: mock.clone(), + actual_hits: Arc::new(AtomicUsize::default()), + }) + .collect() + }) + .unwrap_or_default(); + + let spec_path = spec + .path + .strip_prefix(std::env::current_dir().unwrap()) + .unwrap_or(&spec.path) + .to_string_lossy() + .into_owned(); + + Http { mocks, spec_path } + } + + pub fn test_hits(&self, path: impl AsRef) { + for mock in &self.mocks { + mock.test_hits(path.as_ref()); + } + } +} + +fn string_to_bytes(input: &str) -> Vec { + let mut bytes = Vec::new(); + let mut chars = input.chars().peekable(); + + while let Some(c) = chars.next() { + match c { + '\\' => match chars.next() { + Some('0') => bytes.push(0), + Some('n') => bytes.push(b'\n'), + Some('t') => bytes.push(b'\t'), + Some('r') => bytes.push(b'\r'), + Some('\\') => bytes.push(b'\\'), + Some('\"') => bytes.push(b'\"'), + Some('x') => { + let mut hex = chars.next().unwrap().to_string(); + hex.push(chars.next().unwrap()); + let byte = u8::from_str_radix(&hex, 16).unwrap(); + bytes.push(byte); + } + _ => panic!("Unsupported escape sequence"), + }, + _ => bytes.push(c as u8), + } + } + + bytes +} + +#[async_trait::async_trait] +impl HttpIO for Http { + async fn execute(&self, req: reqwest::Request) -> anyhow::Result> { + // Determine if the request is a GRPC request based on PORT + let is_grpc = req.url().as_str().contains("50051"); + + // Try to find a matching mock for the incoming request. + let execution_mock = self + .mocks + .iter() + .find(|mock| { + let mock_req = &mock.mock.request; + let method_match = req.method() == mock_req.0.method.clone().to_hyper(); + let url_match = req.url().as_str() == mock_req.0.url.clone().as_str(); + let req_body = match req.body() { + Some(body) => { + if let Some(bytes) = body.as_bytes() { + if let Ok(body_str) = std::str::from_utf8(bytes) { + Value::from(body_str) + } else { + Value::Null + } + } else { + Value::Null + } + } + None => Value::Null, + }; + let body_match = req_body == mock_req.0.body; + let headers_match = req + .headers() + .iter() + .filter(|(key, _)| *key != "content-type") + .all(|(key, value)| { + let header_name = key.to_string(); + + let header_value = value.to_str().unwrap(); + let mock_header_value = "".to_string(); + let mock_header_value = mock_req + .0 + .headers + .get(&header_name) + .unwrap_or(&mock_header_value); + header_value == mock_header_value + }); + method_match && url_match && headers_match && (body_match || is_grpc) + }) + .ok_or(anyhow!( + "No mock found for request: {:?} {} in {}", + req.method(), + req.url(), + self.spec_path + ))?; + + execution_mock.actual_hits.fetch_add(1, Ordering::Relaxed); + + // Clone the response from the mock to avoid borrowing issues. + let mock_response = execution_mock.mock.response.clone(); + + // Build the response with the status code from the mock. + let status_code = reqwest::StatusCode::from_u16(mock_response.0.status)?; + + if status_code.is_client_error() || status_code.is_server_error() { + return Err(anyhow::format_err!("Status code error")); + } + + let mut response = Response { status: status_code, ..Default::default() }; + + // Insert headers from the mock into the response. + for (key, value) in mock_response.0.headers { + let header_name = HeaderName::from_str(&key)?; + let header_value = HeaderValue::from_str(&value)?; + response.headers.insert(header_name, header_value); + } + + // Special Handling for GRPC + if let Some(body) = mock_response.0.text_body { + // Return plaintext body if specified + let body = string_to_bytes(&body); + response.body = Bytes::from_iter(body); + } else if is_grpc { + // Special Handling for GRPC + let body = string_to_bytes(mock_response.0.body.as_str().unwrap_or_default()); + response.body = Bytes::from_iter(body); + } else { + let body = serde_json::to_vec(&mock_response.0.body)?; + response.body = Bytes::from_iter(body); + } + + Ok(response) + } +} diff --git a/tests/core/mod.rs b/tests/core/mod.rs new file mode 100644 index 0000000000..71e3d53574 --- /dev/null +++ b/tests/core/mod.rs @@ -0,0 +1,7 @@ +mod env; +mod file; +mod http; +mod model; +mod parse; +mod runtime; +pub mod spec; diff --git a/tests/core/model.rs b/tests/core/model.rs new file mode 100644 index 0000000000..77167876a6 --- /dev/null +++ b/tests/core/model.rs @@ -0,0 +1,63 @@ +use std::collections::BTreeMap; + +use serde::{Deserialize, Serialize}; +use tailcall::http::Method; +use url::Url; + +#[derive(Serialize, Deserialize, Clone, Debug)] +#[serde(rename_all = "camelCase")] +pub enum Annotation { + Skip, + Only, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub struct UpstreamRequest(pub APIRequest); + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UpstreamResponse(pub APIResponse); + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct Mock { + pub request: UpstreamRequest, + pub response: UpstreamResponse, + #[serde(default = "default_expected_hits")] + pub expected_hits: usize, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub struct APIRequest { + #[serde(default)] + pub method: Method, + pub url: Url, + #[serde(default)] + pub headers: BTreeMap, + #[serde(default)] + pub body: serde_json::Value, + #[serde(default)] + pub test_traces: bool, + #[serde(default)] + pub test_metrics: bool, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +#[serde(rename_all = "camelCase")] +pub struct APIResponse { + #[serde(default = "default_status")] + pub status: u16, + #[serde(default)] + pub headers: BTreeMap, + #[serde(default)] + pub body: serde_json::Value, + #[serde(default)] + #[serde(skip_serializing_if = "Option::is_none")] + pub text_body: Option, +} + +fn default_status() -> u16 { + 200 +} + +fn default_expected_hits() -> usize { + 1 +} diff --git a/tests/core/parse.rs b/tests/core/parse.rs new file mode 100644 index 0000000000..6ab08d26c0 --- /dev/null +++ b/tests/core/parse.rs @@ -0,0 +1,306 @@ +extern crate core; + +use std::borrow::Cow; +use std::collections::{BTreeMap, HashMap}; +use std::panic; +use std::path::Path; +use std::str::FromStr; +use std::sync::Arc; + +use anyhow::anyhow; +use markdown::mdast::Node; +use markdown::ParseOptions; +use tailcall::blueprint::Blueprint; +use tailcall::cache::InMemoryCache; +use tailcall::cli::javascript; +use tailcall::config::{ConfigModule, Source}; +use tailcall::http::AppContext; +use tailcall::runtime::TargetRuntime; +use tailcall::EnvIO; + +use super::file::File; +use super::http::Http; +use super::model::*; +use super::runtime::ExecutionSpec; + +struct Env { + env: HashMap, +} + +impl EnvIO for Env { + fn get(&self, key: &str) -> Option> { + self.env.get(key).map(Cow::from) + } +} + +impl Env { + pub fn init(map: HashMap) -> Self { + Self { env: map } + } +} + +impl ExecutionSpec { + pub async fn from_source(path: &Path, contents: String) -> anyhow::Result { + let ast = markdown::to_mdast(&contents, &ParseOptions::default()).unwrap(); + let mut children = ast + .children() + .unwrap_or_else(|| panic!("Failed to parse {:?}: empty file unexpected", path)) + .iter() + .peekable(); + + let mut name: Option = None; + let mut server: Vec<(Source, String)> = Vec::with_capacity(2); + let mut mock: Option> = None; + let mut env: Option> = None; + let mut files: BTreeMap = BTreeMap::new(); + let mut test: Option> = None; + let mut runner: Option = None; + let mut check_identity = false; + let mut sdl_error = false; + + while let Some(node) = children.next() { + match node { + Node::Heading(heading) => { + if heading.depth == 1 { + // Parse test name + if name.is_none() { + if let Some(Node::Text(text)) = heading.children.first() { + name = Some(text.value.clone()); + } else { + return Err(anyhow!( + "Unexpected content of level 1 heading in {:?}: {:#?}", + path, + heading + )); + } + } else { + return Err(anyhow!( + "Unexpected double-declaration of test name in {:?}", + path + )); + } + + // Consume optional test description + if let Some(Node::Paragraph(_)) = children.peek() { + let _ = children.next(); + } + } else if heading.depth == 2 { + if let Some(Node::Text(expect)) = heading.children.first() { + let split = expect.value.splitn(2, ':').collect::>(); + match split[..] { + [a, b] => { + check_identity = + a.contains("check_identity") && b.ends_with("true"); + sdl_error = a.contains("expect_validation_error") + && b.ends_with("true"); + } + _ => { + return Err(anyhow!( + "Unexpected header annotation {:?} in {:?}", + expect.value, + path, + )) + } + } + } + } else if heading.depth == 5 { + // Parse annotation + if runner.is_none() { + if let Some(Node::Text(text)) = heading.children.first() { + runner = Some(match text.value.as_str() { + "skip" => Annotation::Skip, + "only" => Annotation::Only, + _ => { + return Err(anyhow!( + "Unexpected runner annotation {:?} in {:?}", + text.value, + path, + )); + } + }); + } else { + return Err(anyhow!( + "Unexpected content of level 5 heading in {:?}: {:#?}", + path, + heading + )); + } + } else { + return Err(anyhow!( + "Unexpected double-declaration of runner annotation in {:?}", + path + )); + } + } else if heading.depth == 4 { + } else { + return Err(anyhow!( + "Unexpected level {} heading in {:?}: {:#?}", + heading.depth, + path, + heading + )); + } + } + Node::Code(code) => { + // Parse following code block + let (content, lang, meta) = { + ( + code.value.to_owned(), + code.lang.to_owned(), + code.meta.to_owned(), + ) + }; + if let Some(meta_str) = meta.as_ref().filter(|s| s.contains('@')) { + let temp_cleaned_meta = meta_str.replace('@', ""); + let name: &str = &temp_cleaned_meta; + if let Some(name) = name.strip_prefix("file:") { + if files.insert(name.to_string(), content).is_some() { + return Err(anyhow!( + "Double declaration of file {:?} in {:#?}", + name, + path + )); + } + } else { + let lang = match lang { + Some(x) => Ok(x), + None => Err(anyhow!( + "Unexpected code block with no specific language in {:?}", + path + )), + }?; + + let source = Source::from_str(&lang)?; + + match name { + "server" => { + // Server configs are only parsed if the test isn't skipped. + server.push((source, content)); + } + "mock" => { + if mock.is_none() { + mock = match source { + Source::Json => Ok(serde_json::from_str(&content)?), + Source::Yml => Ok(serde_yaml::from_str(&content)?), + _ => Err(anyhow!("Unexpected language in mock block in {:?} (only JSON and YAML are supported)", path)), + }?; + } else { + return Err(anyhow!("Unexpected number of mock blocks in {:?} (only one is allowed)", path)); + } + } + "env" => { + if env.is_none() { + env = match source { + Source::Json => Ok(serde_json::from_str(&content)?), + Source::Yml => Ok(serde_yaml::from_str(&content)?), + _ => Err(anyhow!("Unexpected language in env block in {:?} (only JSON and YAML are supported)", path)), + }?; + } else { + return Err(anyhow!("Unexpected number of env blocks in {:?} (only one is allowed)", path)); + } + } + "test" => { + if test.is_none() { + test = match source { + Source::Json => Ok(serde_json::from_str(&content)?), + Source::Yml => Ok(serde_yaml::from_str(&content)?), + _ => Err(anyhow!("Unexpected language in test block in {:?} (only JSON and YAML are supported)", path)), + }?; + } else { + return Err(anyhow!("Unexpected number of test blocks in {:?} (only one is allowed)", path)); + } + } + _ => { + return Err(anyhow!( + "Unexpected component {:?} in {:?}: {:#?}", + name, + path, + meta + )); + } + } + } + } else { + return Err(anyhow!( + "Unexpected content of code in {:?}: {:#?}", + path, + meta + )); + } + } + Node::Definition(d) => { + if let Some(title) = &d.title { + tracing::info!("Comment found in: {:?} with title: {}", path, title); + } + } + Node::ThematicBreak(_) => { + // skip this for and put execute logic in heading.depth + // above to escape ThematicBreaks like + // `---`, `***` or `___` + } + _ => return Err(anyhow!("Unexpected node in {:?}: {:#?}", path, node)), + } + } + + if server.is_empty() { + return Err(anyhow!( + "Unexpected blocks in {:?}: You must define a GraphQL Config in an execution test.", + path, + )); + } + + let spec = ExecutionSpec { + path: path.to_owned(), + name: name.unwrap_or_else(|| path.file_name().unwrap().to_str().unwrap().to_string()), + safe_name: path.file_name().unwrap().to_str().unwrap().to_string(), + + server, + mock, + env, + test, + files, + + runner, + + check_identity, + sdl_error, + }; + + anyhow::Ok(spec) + } + + pub async fn app_context( + &self, + config: &ConfigModule, + env: HashMap, + http_client: Arc, + ) -> Arc { + let blueprint = Blueprint::try_from(config).unwrap(); + let http = if let Some(script) = blueprint.server.script.clone() { + javascript::init_http(http_client, script) + } else { + http_client + }; + + let http2_only = http.clone(); + + let runtime = TargetRuntime { + http, + http2_only, + file: Arc::new(File::new(self.clone())), + env: Arc::new(Env::init(env)), + cache: Arc::new(InMemoryCache::new()), + extensions: Arc::new(vec![]), + }; + + let endpoints = config + .extensions + .endpoint_set + .clone() + .into_checked(&blueprint, runtime.clone()) + .await + .unwrap(); + + Arc::new(AppContext::new(blueprint, runtime, endpoints)) + } +} diff --git a/tests/core/runtime.rs b/tests/core/runtime.rs new file mode 100644 index 0000000000..1ccd61a6e1 --- /dev/null +++ b/tests/core/runtime.rs @@ -0,0 +1,108 @@ +extern crate core; + +use std::collections::{BTreeMap, HashMap}; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; + +use derive_setters::Setters; +use tailcall::blueprint; +use tailcall::cache::InMemoryCache; +use tailcall::cli::javascript; +use tailcall::config::Source; +use tailcall::runtime::TargetRuntime; + +use super::env::Env; +use super::file::TestFileIO; +use super::http::Http; +use super::model::*; + +#[derive(Clone, Setters)] +pub struct ExecutionSpec { + pub path: PathBuf, + pub name: String, + pub safe_name: String, + + pub server: Vec<(Source, String)>, + pub mock: Option>, + pub env: Option>, + pub test: Option>, + pub files: BTreeMap, + + // Annotations for the runner + pub runner: Option, + + pub check_identity: bool, + pub sdl_error: bool, +} + +#[derive(Clone, Debug)] +pub struct ExecutionMock { + pub mock: Mock, + pub actual_hits: Arc, +} + +impl ExecutionMock { + pub fn test_hits(&self, path: impl AsRef) { + let url = &self.mock.request.0.url; + let is_batch_graphql = url.path().starts_with("/graphql") + && self + .mock + .request + .0 + .body + .as_str() + .map(|s| s.contains(',')) + .unwrap_or_default(); + + // do not test hits for mocks for batch graphql requests + // since that requires having 2 mocks with different order of queries in + // single request and only one of that mocks is actually called during run. + // for other protocols there is no issues right now, because: + // - for http the keys are always sorted https://github.com/tailcallhq/tailcall/blob/51d8b7aff838f0f4c362d4ee9e39492ae1f51fdb/src/http/data_loader.rs#L71 + // - for grpc body is not used for matching the mock and grpc will use grouping based on id https://github.com/tailcallhq/tailcall/blob/733b641c41f17c60b15b36b025b4db99d0f9cdcd/tests/execution_spec.rs#L769 + if is_batch_graphql { + return; + } + + let expected_hits = self.mock.expected_hits; + let actual_hits = self.actual_hits.load(Ordering::Relaxed); + + assert_eq!( + expected_hits, + actual_hits, + "expected mock for {url} to be hit exactly {expected_hits} times, but it was hit {actual_hits} times for file: {:?}", + path.as_ref() + ); + } +} + +pub fn create_runtime( + http_client: Arc, + env: Option>, + script: Option, +) -> TargetRuntime { + let http = if let Some(script) = script.clone() { + javascript::init_http(http_client.clone(), script) + } else { + http_client.clone() + }; + + let http2 = if let Some(script) = script { + javascript::init_http(http_client.clone(), script) + } else { + http_client.clone() + }; + + let file = TestFileIO::init(); + let env = Env::init(env); + + TargetRuntime { + http, + http2_only: http2, + env: Arc::new(env), + file: Arc::new(file), + cache: Arc::new(InMemoryCache::new()), + extensions: Arc::new(vec![]), + } +} diff --git a/tests/core/snapshots/add-field-index-list.md_0.snap b/tests/core/snapshots/add-field-index-list.md_0.snap new file mode 100644 index 0000000000..a5b7c188b6 --- /dev/null +++ b/tests/core/snapshots/add-field-index-list.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "username": "Leanne Graham" + } + } +} diff --git a/tests/core/snapshots/add-field-index-list.md_client.snap b/tests/core/snapshots/add-field-index-list.md_client.snap new file mode 100644 index 0000000000..d5d22b778c --- /dev/null +++ b/tests/core/snapshots/add-field-index-list.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + username: String + users: [User] +} + +scalar Url + +type User { + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-index-list.md_merged.snap b/tests/core/snapshots/add-field-index-list.md_merged.snap new file mode 100644 index 0000000000..592c6f8c8f --- /dev/null +++ b/tests/core/snapshots/add-field-index-list.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query @addField(name: "username", path: ["users", "0", "name"]) { + users: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") +} + +type User { + name: String +} diff --git a/tests/core/snapshots/add-field-many-list.md_client.snap b/tests/core/snapshots/add-field-many-list.md_client.snap new file mode 100644 index 0000000000..f9e78bca84 --- /dev/null +++ b/tests/core/snapshots/add-field-many-list.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type A { + b: [String] + c: String + d: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + u: U +} + +type U { + a: A + b: [String] + c: String + d: String + e: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-many-list.md_merged.snap b/tests/core/snapshots/add-field-many-list.md_merged.snap new file mode 100644 index 0000000000..e5802ae7b9 --- /dev/null +++ b/tests/core/snapshots/add-field-many-list.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type A { + b: [String] + c: String + d: String +} + +type Query { + u: U @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/us/1") +} + +type U @addField(name: "b", path: ["a", "b"]) @addField(name: "c", path: ["a", "c"]) @addField(name: "d", path: ["a", "d"]) { + a: A + e: String +} diff --git a/tests/core/snapshots/add-field-many.md_client.snap b/tests/core/snapshots/add-field-many.md_client.snap new file mode 100644 index 0000000000..df7485155d --- /dev/null +++ b/tests/core/snapshots/add-field-many.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +type Foo { + a: String + b: String + c: String + name: String + x: X +} + +scalar JSON + +scalar PhoneNumber + +type Query { + user: Foo +} + +scalar Url + +type X { + a: String + b: String + c: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-many.md_merged.snap b/tests/core/snapshots/add-field-many.md_merged.snap new file mode 100644 index 0000000000..647189833f --- /dev/null +++ b/tests/core/snapshots/add-field-many.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Foo @addField(name: "a", path: ["x", "a"]) @addField(name: "b", path: ["x", "b"]) @addField(name: "c", path: ["x", "c"]) { + name: String + x: X +} + +type Query { + user: Foo @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type X { + a: String + b: String + c: String +} diff --git a/tests/core/snapshots/add-field-modify.md_0.snap b/tests/core/snapshots/add-field-modify.md_0.snap new file mode 100644 index 0000000000..0e5c653400 --- /dev/null +++ b/tests/core/snapshots/add-field-modify.md_0.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "foo", + "street": "Kulas Light", + "city": "Gwenborough", + "zipcode": "92998-3874" + } + } + } +} diff --git a/tests/core/snapshots/add-field-modify.md_client.snap b/tests/core/snapshots/add-field-modify.md_client.snap new file mode 100644 index 0000000000..fc6f9a2307 --- /dev/null +++ b/tests/core/snapshots/add-field-modify.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Address { + city: String + street: String + zipcode: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: Address + city: String + name: String + street: String + zipcode: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-modify.md_merged.snap b/tests/core/snapshots/add-field-modify.md_merged.snap new file mode 100644 index 0000000000..9c5aa370a1 --- /dev/null +++ b/tests/core/snapshots/add-field-modify.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + city: String + street: String + zipcode: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "street", path: ["address", "street"]) @addField(name: "city", path: ["address", "city"]) @addField(name: "zipcode", path: ["address", "zipcode"]) { + address: Address + name: String +} diff --git a/tests/core/snapshots/add-field-with-composition.md_0.snap b/tests/core/snapshots/add-field-with-composition.md_0.snap new file mode 100644 index 0000000000..68e1ab14ee --- /dev/null +++ b/tests/core/snapshots/add-field-with-composition.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "lat": "-37.3159" + } + } +} diff --git a/tests/core/snapshots/add-field-with-composition.md_1.snap b/tests/core/snapshots/add-field-with-composition.md_1.snap new file mode 100644 index 0000000000..cbe3b96cf9 --- /dev/null +++ b/tests/core/snapshots/add-field-with-composition.md_1.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "lng": "81.1496" + } + } +} diff --git a/tests/core/snapshots/add-field-with-composition.md_client.snap b/tests/core/snapshots/add-field-with-composition.md_client.snap new file mode 100644 index 0000000000..4523b470a5 --- /dev/null +++ b/tests/core/snapshots/add-field-with-composition.md_client.snap @@ -0,0 +1,39 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Address { + geo: Geo + street: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Geo { + lat: String + lng: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + lat: String + lng: String + user: User +} + +scalar Url + +type User { + address: Address +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-with-composition.md_merged.snap b/tests/core/snapshots/add-field-with-composition.md_merged.snap new file mode 100644 index 0000000000..973665cb76 --- /dev/null +++ b/tests/core/snapshots/add-field-with-composition.md_merged.snap @@ -0,0 +1,25 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + geo: Geo + street: String +} + +type Geo { + lat: String + lng: String +} + +type Query @addField(name: "lat", path: ["user", "address", "geo", "lat"]) @addField(name: "lng", path: ["user", "address", "geo", "lng"]) { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + address: Address +} diff --git a/tests/core/snapshots/add-field-with-modify.md_0.snap b/tests/core/snapshots/add-field-with-modify.md_0.snap new file mode 100644 index 0000000000..f6d155936f --- /dev/null +++ b/tests/core/snapshots/add-field-with-modify.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user1": "Leanne Graham" + } + } +} diff --git a/tests/core/snapshots/add-field-with-modify.md_1.snap b/tests/core/snapshots/add-field-with-modify.md_1.snap new file mode 100644 index 0000000000..7dbe361ffc --- /dev/null +++ b/tests/core/snapshots/add-field-with-modify.md_1.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user2": "Ervin Howell" + } + } +} diff --git a/tests/core/snapshots/add-field-with-modify.md_client.snap b/tests/core/snapshots/add-field-with-modify.md_client.snap new file mode 100644 index 0000000000..742a75a643 --- /dev/null +++ b/tests/core/snapshots/add-field-with-modify.md_client.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + person1: User + person2: User + user1: String + user2: String +} + +scalar Url + +type User { + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field-with-modify.md_merged.snap b/tests/core/snapshots/add-field-with-modify.md_merged.snap new file mode 100644 index 0000000000..cad2840a4c --- /dev/null +++ b/tests/core/snapshots/add-field-with-modify.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query @addField(name: "user1", path: ["person1", "name"]) @addField(name: "user2", path: ["person2", "name"]) { + person1: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") + person2: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/2") +} + +type User { + name: String +} diff --git a/tests/core/snapshots/add-field.md_0.snap b/tests/core/snapshots/add-field.md_0.snap new file mode 100644 index 0000000000..46dcd8c3b2 --- /dev/null +++ b/tests/core/snapshots/add-field.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "lat": "-37.3159" + } + } + } +} diff --git a/tests/core/snapshots/add-field.md_client.snap b/tests/core/snapshots/add-field.md_client.snap new file mode 100644 index 0000000000..2f1822decb --- /dev/null +++ b/tests/core/snapshots/add-field.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Address { + geo: Geo +} + +scalar Date + +scalar Email + +scalar Empty + +type Geo { + lat: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: Address + lat: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/add-field.md_merged.snap b/tests/core/snapshots/add-field.md_merged.snap new file mode 100644 index 0000000000..82d16a885b --- /dev/null +++ b/tests/core/snapshots/add-field.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + geo: Geo +} + +type Geo { + lat: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "lat", path: ["address", "geo", "lat"]) { + address: Address +} diff --git a/tests/core/snapshots/apollo-tracing.md_0.snap b/tests/core/snapshots/apollo-tracing.md_0.snap new file mode 100644 index 0000000000..d1aa07b391 --- /dev/null +++ b/tests/core/snapshots/apollo-tracing.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "hello": "hello" + } + } +} diff --git a/tests/core/snapshots/apollo-tracing.md_client.snap b/tests/core/snapshots/apollo-tracing.md_client.snap new file mode 100644 index 0000000000..bc438e3a5d --- /dev/null +++ b/tests/core/snapshots/apollo-tracing.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hello: String! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/apollo-tracing.md_merged.snap b/tests/core/snapshots/apollo-tracing.md_merged.snap new file mode 100644 index 0000000000..c65bafe30d --- /dev/null +++ b/tests/core/snapshots/apollo-tracing.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream { + query: Query +} + +type Query { + hello: String! @http(baseURL: "http://api.com", path: "/") +} diff --git a/tests/core/snapshots/auth-basic.md_0.snap b/tests/core/snapshots/auth-basic.md_0.snap new file mode 100644 index 0000000000..19966dbd12 --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_0.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "scalar": "data from public scalar", + "nested": { + "name": "nested name" + } + } + } +} diff --git a/tests/core/snapshots/auth-basic.md_1.snap b/tests/core/snapshots/auth-basic.md_1.snap new file mode 100644 index 0000000000..5fd8164e7c --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_1.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Missing Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-basic.md_2.snap b/tests/core/snapshots/auth-basic.md_2.snap new file mode 100644 index 0000000000..1147bdbb16 --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_2.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Invalid Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-basic.md_3.snap b/tests/core/snapshots/auth-basic.md_3.snap new file mode 100644 index 0000000000..5a8bbd2fd3 --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_3.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "protectedScalar": "data from protected scalar", + "nested": { + "name": "nested name", + "protected": "protected nested" + }, + "protectedType": { + "name": "protected type name", + "nested": "protected type nested" + } + } + } +} diff --git a/tests/core/snapshots/auth-basic.md_4.snap b/tests/core/snapshots/auth-basic.md_4.snap new file mode 100644 index 0000000000..5fd8164e7c --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_4.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Missing Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-basic.md_5.snap b/tests/core/snapshots/auth-basic.md_5.snap new file mode 100644 index 0000000000..1afd85d51b --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_5.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "protectedType": { + "name": "mutation name", + "nested": "mutation nested" + } + } + } +} diff --git a/tests/core/snapshots/auth-basic.md_6.snap b/tests/core/snapshots/auth-basic.md_6.snap new file mode 100644 index 0000000000..1147bdbb16 --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_6.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Invalid Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-basic.md_client.snap b/tests/core/snapshots/auth-basic.md_client.snap new file mode 100644 index 0000000000..6e5e77070f --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_client.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + protectedType: ProtectedType +} + +type Nested { + name: String! + protected: String! +} + +scalar PhoneNumber + +type ProtectedType { + name: String! + nested: String! +} + +type Query { + nested: Nested! + protectedScalar: String! + protectedType: ProtectedType + scalar: String! +} + +scalar Url + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/auth-basic.md_merged.snap b/tests/core/snapshots/auth-basic.md_merged.snap new file mode 100644 index 0000000000..4e174cdbc4 --- /dev/null +++ b/tests/core/snapshots/auth-basic.md_merged.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { + query: Query + mutation: Mutation +} + +type Mutation { + protectedType: ProtectedType @http(baseURL: "http://upstream", path: "/protected") +} + +type Nested { + name: String! + protected: String! @protected +} + +type ProtectedType @protected { + name: String! + nested: String! +} + +type Query { + nested: Nested! @expr(body: {name: "nested name", protected: "protected nested"}) + protectedScalar: String! @expr(body: "data from protected scalar") @protected + protectedType: ProtectedType @expr(body: {name: "protected type name", nested: "protected type nested"}) + scalar: String! @expr(body: "data from public scalar") +} diff --git a/tests/core/snapshots/auth-jwt.md_0.snap b/tests/core/snapshots/auth-jwt.md_0.snap new file mode 100644 index 0000000000..19966dbd12 --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_0.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "scalar": "data from public scalar", + "nested": { + "name": "nested name" + } + } + } +} diff --git a/tests/core/snapshots/auth-jwt.md_1.snap b/tests/core/snapshots/auth-jwt.md_1.snap new file mode 100644 index 0000000000..5fd8164e7c --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_1.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Missing Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-jwt.md_2.snap b/tests/core/snapshots/auth-jwt.md_2.snap new file mode 100644 index 0000000000..5a8bbd2fd3 --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_2.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "protectedScalar": "data from protected scalar", + "nested": { + "name": "nested name", + "protected": "protected nested" + }, + "protectedType": { + "name": "protected type name", + "nested": "protected type nested" + } + } + } +} diff --git a/tests/core/snapshots/auth-jwt.md_3.snap b/tests/core/snapshots/auth-jwt.md_3.snap new file mode 100644 index 0000000000..5fd8164e7c --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_3.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Missing Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-jwt.md_4.snap b/tests/core/snapshots/auth-jwt.md_4.snap new file mode 100644 index 0000000000..1afd85d51b --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_4.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "protectedType": { + "name": "mutation name", + "nested": "mutation nested" + } + } + } +} diff --git a/tests/core/snapshots/auth-jwt.md_5.snap b/tests/core/snapshots/auth-jwt.md_5.snap new file mode 100644 index 0000000000..1147bdbb16 --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_5.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Authentication Failure: Invalid Authorization Header", + "locations": [ + { + "line": 2, + "column": 3 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/auth-jwt.md_client.snap b/tests/core/snapshots/auth-jwt.md_client.snap new file mode 100644 index 0000000000..6e5e77070f --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_client.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + protectedType: ProtectedType +} + +type Nested { + name: String! + protected: String! +} + +scalar PhoneNumber + +type ProtectedType { + name: String! + nested: String! +} + +type Query { + nested: Nested! + protectedScalar: String! + protectedType: ProtectedType + scalar: String! +} + +scalar Url + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/auth-jwt.md_merged.snap b/tests/core/snapshots/auth-jwt.md_merged.snap new file mode 100644 index 0000000000..9ea0b077da --- /dev/null +++ b/tests/core/snapshots/auth-jwt.md_merged.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream @link(id: "jwks", src: "jwks.json", type: Jwks) { + query: Query + mutation: Mutation +} + +type Mutation { + protectedType: ProtectedType @http(baseURL: "http://upstream", path: "/protected") +} + +type Nested { + name: String! + protected: String! @protected +} + +type ProtectedType @protected { + name: String! + nested: String! +} + +type Query { + nested: Nested! @expr(body: {name: "nested name", protected: "protected nested"}) + protectedScalar: String! @expr(body: "data from protected scalar") @protected + protectedType: ProtectedType @expr(body: {name: "protected type name", nested: "protected type nested"}) + scalar: String! @expr(body: "data from public scalar") +} diff --git a/tests/core/snapshots/auth.md_client.snap b/tests/core/snapshots/auth.md_client.snap new file mode 100644 index 0000000000..225f264c60 --- /dev/null +++ b/tests/core/snapshots/auth.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + data: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/auth.md_merged.snap b/tests/core/snapshots/auth.md_merged.snap new file mode 100644 index 0000000000..f89a8e3187 --- /dev/null +++ b/tests/core/snapshots/auth.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) @link(id: "jwks", src: "jwks.json", type: Jwks) { + query: Query +} + +type Query { + data: String @expr(body: "data") @protected +} diff --git a/tests/core/snapshots/batching-default.md_0.snap b/tests/core/snapshots/batching-default.md_0.snap new file mode 100644 index 0000000000..f83fd2bba9 --- /dev/null +++ b/tests/core/snapshots/batching-default.md_0.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user": { + "id": 1 + }, + "userId": 1 + }, + { + "user": { + "id": 2 + }, + "userId": 2 + } + ] + } + } +} diff --git a/tests/core/snapshots/batching-default.md_client.snap b/tests/core/snapshots/batching-default.md_client.snap new file mode 100644 index 0000000000..7ae47b261d --- /dev/null +++ b/tests/core/snapshots/batching-default.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching-default.md_merged.snap b/tests/core/snapshots/batching-default.md_merged.snap new file mode 100644 index 0000000000..0ef8726355 --- /dev/null +++ b/tests/core/snapshots/batching-default.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 10, headers: []}, httpCache: true) { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/batching-disabled.md_0.snap b/tests/core/snapshots/batching-disabled.md_0.snap new file mode 100644 index 0000000000..e8bca1fdcc --- /dev/null +++ b/tests/core/snapshots/batching-disabled.md_0.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "u1": { + "id": 1 + }, + "u2": { + "id": 2 + } + } + } +} diff --git a/tests/core/snapshots/batching-disabled.md_client.snap b/tests/core/snapshots/batching-disabled.md_client.snap new file mode 100644 index 0000000000..29257d2d5f --- /dev/null +++ b/tests/core/snapshots/batching-disabled.md_client.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int + name: String + username: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching-disabled.md_merged.snap b/tests/core/snapshots/batching-disabled.md_merged.snap new file mode 100644 index 0000000000..30586519f5 --- /dev/null +++ b/tests/core/snapshots/batching-disabled.md_merged.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 0, headers: [], maxSize: 100}, httpCache: true) { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/{{.args.id}}") +} + +type User { + id: Int + name: String + username: String +} diff --git a/tests/core/snapshots/batching-group-by-default.md_0.snap b/tests/core/snapshots/batching-group-by-default.md_0.snap new file mode 100644 index 0000000000..f83fd2bba9 --- /dev/null +++ b/tests/core/snapshots/batching-group-by-default.md_0.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user": { + "id": 1 + }, + "userId": 1 + }, + { + "user": { + "id": 2 + }, + "userId": 2 + } + ] + } + } +} diff --git a/tests/core/snapshots/batching-group-by-default.md_client.snap b/tests/core/snapshots/batching-group-by-default.md_client.snap new file mode 100644 index 0000000000..7ae47b261d --- /dev/null +++ b/tests/core/snapshots/batching-group-by-default.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching-group-by-default.md_merged.snap b/tests/core/snapshots/batching-group-by-default.md_merged.snap new file mode 100644 index 0000000000..7dc15f9633 --- /dev/null +++ b/tests/core/snapshots/batching-group-by-default.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/batching-group-by.md_0.snap b/tests/core/snapshots/batching-group-by.md_0.snap new file mode 100644 index 0000000000..f83fd2bba9 --- /dev/null +++ b/tests/core/snapshots/batching-group-by.md_0.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user": { + "id": 1 + }, + "userId": 1 + }, + { + "user": { + "id": 2 + }, + "userId": 2 + } + ] + } + } +} diff --git a/tests/core/snapshots/batching-group-by.md_client.snap b/tests/core/snapshots/batching-group-by.md_client.snap new file mode 100644 index 0000000000..7ae47b261d --- /dev/null +++ b/tests/core/snapshots/batching-group-by.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching-group-by.md_merged.snap b/tests/core/snapshots/batching-group-by.md_merged.snap new file mode 100644 index 0000000000..2b75106aca --- /dev/null +++ b/tests/core/snapshots/batching-group-by.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/batching-post.md_0.snap b/tests/core/snapshots/batching-post.md_0.snap new file mode 100644 index 0000000000..43853b4346 --- /dev/null +++ b/tests/core/snapshots/batching-post.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user": { + "name": "Leanne Graham" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/batching-post.md_client.snap b/tests/core/snapshots/batching-post.md_client.snap new file mode 100644 index 0000000000..7ae47b261d --- /dev/null +++ b/tests/core/snapshots/batching-post.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching-post.md_merged.snap b/tests/core/snapshots/batching-post.md_merged.snap new file mode 100644 index 0000000000..34b9791fe7 --- /dev/null +++ b/tests/core/snapshots/batching-post.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(path: "/users/{{.value.userId}}") + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts?id=1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/batching.md_0.snap b/tests/core/snapshots/batching.md_0.snap new file mode 100644 index 0000000000..b1a1411d19 --- /dev/null +++ b/tests/core/snapshots/batching.md_0.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": [ + { + "data": { + "user": { + "id": 1 + } + } + }, + { + "data": { + "user": { + "name": "foo" + } + } + } + ] +} diff --git a/tests/core/snapshots/batching.md_1.snap b/tests/core/snapshots/batching.md_1.snap new file mode 100644 index 0000000000..4a83588a1a --- /dev/null +++ b/tests/core/snapshots/batching.md_1.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "id": 1 + } + } + } +} diff --git a/tests/core/snapshots/batching.md_2.snap b/tests/core/snapshots/batching.md_2.snap new file mode 100644 index 0000000000..2d278c54f5 --- /dev/null +++ b/tests/core/snapshots/batching.md_2.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": " --> 1:1\n |\n1 | FOO\n | ^---\n |\n = expected executable_definition", + "locations": [ + { + "line": 1, + "column": 1 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/batching.md_client.snap b/tests/core/snapshots/batching.md_client.snap new file mode 100644 index 0000000000..f8c9c2fa86 --- /dev/null +++ b/tests/core/snapshots/batching.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/batching.md_merged.snap b/tests/core/snapshots/batching.md_merged.snap new file mode 100644 index 0000000000..71f73427cb --- /dev/null +++ b/tests/core/snapshots/batching.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(batchRequests: true) @upstream { + query: Query +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/cache-control.md_0.snap b/tests/core/snapshots/cache-control.md_0.snap new file mode 100644 index 0000000000..c3c2762363 --- /dev/null +++ b/tests/core/snapshots/cache-control.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "cache-control": "max-age=3600", + "content-type": "application/json" + }, + "body": { + "data": { + "u1": { + "id": 1 + }, + "u2": { + "id": 2 + } + } + } +} diff --git a/tests/core/snapshots/cache-control.md_1.snap b/tests/core/snapshots/cache-control.md_1.snap new file mode 100644 index 0000000000..c84152761a --- /dev/null +++ b/tests/core/snapshots/cache-control.md_1.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "cache-control": "max-age=3600, private", + "content-type": "application/json" + }, + "body": { + "data": { + "u1": { + "id": 1 + }, + "u3": { + "id": 3 + } + } + } +} diff --git a/tests/core/snapshots/cache-control.md_2.snap b/tests/core/snapshots/cache-control.md_2.snap new file mode 100644 index 0000000000..5ca46d4fd2 --- /dev/null +++ b/tests/core/snapshots/cache-control.md_2.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "cache-control": "no-cache", + "content-type": "application/json" + }, + "body": { + "data": { + "u1": { + "id": 1 + }, + "u4": { + "id": 4 + } + } + } +} diff --git a/tests/core/snapshots/cache-control.md_3.snap b/tests/core/snapshots/cache-control.md_3.snap new file mode 100644 index 0000000000..33705363d3 --- /dev/null +++ b/tests/core/snapshots/cache-control.md_3.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "cache-control": "no-cache, private", + "content-type": "application/json" + }, + "body": { + "data": { + "u3": { + "id": 3 + }, + "u4": { + "id": 4 + } + } + } +} diff --git a/tests/core/snapshots/cache-control.md_client.snap b/tests/core/snapshots/cache-control.md_client.snap new file mode 100644 index 0000000000..7c0bdf72e9 --- /dev/null +++ b/tests/core/snapshots/cache-control.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/cache-control.md_merged.snap b/tests/core/snapshots/cache-control.md_merged.snap new file mode 100644 index 0000000000..ce75b519b4 --- /dev/null +++ b/tests/core/snapshots/cache-control.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {cacheControl: true}) @upstream { + query: Query +} + +type Query { + user(id: Int): User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/caching-collision.md_0.snap b/tests/core/snapshots/caching-collision.md_0.snap new file mode 100644 index 0000000000..78dc9d88b8 --- /dev/null +++ b/tests/core/snapshots/caching-collision.md_0.snap @@ -0,0 +1,616 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "bars": [ + { + "foo": { + "id": 0 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBZh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 1 + }, + "id": "ByVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 2 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SE3mXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 3 + }, + "id": "BEVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 4 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DFPDXIwHe" + }, + { + "foo": { + "id": 5 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSoYIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 6 + }, + "id": "BVVLvrvaKTxZigeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 7 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEomXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 8 + }, + "id": "BVVLvrvaKFxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 9 + }, + "id": "BVVLvrvaKTxZdgeFvePbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 10 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jsz1qh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 11 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ5f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 12 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYftglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 13 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQ7YUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 14 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqp8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 15 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 16 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtHlFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 17 + }, + "id": "BVVLvrvaKTxZdgeFvbPbczXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 18 + }, + "id": "BVVLvrvaKTxZdgeF6bPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 19 + }, + "id": "BVVLvrvaKTxZdgeFGbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 20 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSxrIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 21 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSo9IxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 22 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjrXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 23 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FtO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 24 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3n2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 25 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FoO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 26 + }, + "id": "BVVLvVvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 27 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3VpzFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 28 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoumL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 29 + }, + "id": "BVVLvrvaKTYZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 30 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtgRFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 31 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sfZV2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 32 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwKe" + }, + { + "foo": { + "id": 33 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jjzyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 34 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmcWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 35 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFw4i4DNPDXIwHe" + }, + { + "foo": { + "id": 36 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL3345FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 37 + }, + "id": "BVVLvrvaKTxZdgaFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 38 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImR33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 39 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXRorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 40 + }, + "id": "BVVLvrvfKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 41 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQIf7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 42 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnOImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 43 + }, + "id": "BVVLvrvaKTxZdgeFvbPmckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 44 + }, + "id": "BVVLvrvaKTxZdgeFvbPbc9XSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 45 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3q7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 46 + }, + "id": "BVVLvrvaKTxZdgeFkbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 47 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoTmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 48 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIFmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 49 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33d5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 50 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSosIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 51 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SVjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 52 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4JszyJh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 53 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFhoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 54 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSSrIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 55 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Za6x1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 56 + }, + "id": "BVVLvrvaKTxZdgeFwbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 57 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SIjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 58 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImt33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 59 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoIwL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 60 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdw4DNPDXIwHe" + }, + { + "foo": { + "id": 61 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4J6zyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 62 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jskyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 63 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2NFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 64 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorFxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 65 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25yXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 66 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4lszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 67 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFmdi4DNPDXIwHe" + }, + { + "foo": { + "id": 68 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jsjyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 69 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sfXV2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 70 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYe25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 71 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSogIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 72 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33n5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 73 + }, + "id": "BVVLvrvaKTxZqgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 74 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwJi4DNPDXIwHe" + }, + { + "foo": { + "id": 75 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoKmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 76 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FY625TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 77 + }, + "id": "BVVLvrvaKTzZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 78 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoIFL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 79 + }, + "id": "BVVLvrvNKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 80 + }, + "id": "BVVLvrvaKTMZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 81 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFyoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 82 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3VqzFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 83 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4oszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 84 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDHIwHe" + }, + { + "foo": { + "id": 85 + }, + "id": "BVVLvrvaKvxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 86 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1yf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 87 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f8Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 88 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25rXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 89 + }, + "id": "BVVLvrvaKTxZdgPFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 90 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi45NPDXIwHe" + }, + { + "foo": { + "id": 91 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQHf7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 92 + }, + "id": "BVVLvrvaKTxZdgeFvbPb9kXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 93 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnonmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 94 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUhkJszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 95 + }, + "id": "BVVLvrvFKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 96 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5SYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 97 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Pszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 98 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtgHFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + }, + { + "foo": { + "id": 99 + }, + "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmIUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" + } + ] + } + } +} diff --git a/tests/core/snapshots/caching-collision.md_client.snap b/tests/core/snapshots/caching-collision.md_client.snap new file mode 100644 index 0000000000..97f888869d --- /dev/null +++ b/tests/core/snapshots/caching-collision.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + foo: Foo + id: String! +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + id: Int! +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bars: [Bar] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/caching-collision.md_merged.snap b/tests/core/snapshots/caching-collision.md_merged.snap new file mode 100644 index 0000000000..39aa88d47e --- /dev/null +++ b/tests/core/snapshots/caching-collision.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Bar { + foo: Foo @http(path: "/foo?id={{.value.id}}") @cache(maxAge: 300) + id: String! +} + +type Foo { + id: Int! +} + +type Query @cache(maxAge: 100) { + bars: [Bar] @http(path: "/bars") +} diff --git a/tests/core/snapshots/caching.md_0.snap b/tests/core/snapshots/caching.md_0.snap new file mode 100644 index 0000000000..2121b43f17 --- /dev/null +++ b/tests/core/snapshots/caching.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "fieldCache": { + "id": 1 + } + } + } +} diff --git a/tests/core/snapshots/caching.md_1.snap b/tests/core/snapshots/caching.md_1.snap new file mode 100644 index 0000000000..40625200f5 --- /dev/null +++ b/tests/core/snapshots/caching.md_1.snap @@ -0,0 +1,47 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "fieldCache": { + "id": 1 + }, + "fieldCacheList": [ + { + "id": 1 + }, + { + "id": 2 + }, + { + "id": 3 + } + ], + "typeCache": { + "a": { + "id": 11 + }, + "b": { + "id": 21 + }, + "list": [ + { + "id": 31 + }, + { + "id": 32 + }, + { + "id": 33 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/caching.md_2.snap b/tests/core/snapshots/caching.md_2.snap new file mode 100644 index 0000000000..40625200f5 --- /dev/null +++ b/tests/core/snapshots/caching.md_2.snap @@ -0,0 +1,47 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "fieldCache": { + "id": 1 + }, + "fieldCacheList": [ + { + "id": 1 + }, + { + "id": 2 + }, + { + "id": 3 + } + ], + "typeCache": { + "a": { + "id": 11 + }, + "b": { + "id": 21 + }, + "list": [ + { + "id": 31 + }, + { + "id": 32 + }, + { + "id": 33 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/caching.md_client.snap b/tests/core/snapshots/caching.md_client.snap new file mode 100644 index 0000000000..4b27eea358 --- /dev/null +++ b/tests/core/snapshots/caching.md_client.snap @@ -0,0 +1,35 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + fieldCache: Type + fieldCacheList: [Type] + typeCache: TypeCache +} + +type Type { + id: Int +} + +type TypeCache { + a: Type + b: Type + list: [Type] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/caching.md_merged.snap b/tests/core/snapshots/caching.md_merged.snap new file mode 100644 index 0000000000..c1bff907a4 --- /dev/null +++ b/tests/core/snapshots/caching.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Query { + fieldCache: Type @http(path: "/field-cache") @cache(maxAge: 30000) + fieldCacheList: [Type] @http(path: "/field-cache-list") @cache(maxAge: 30000) + typeCache: TypeCache +} + +type Type { + id: Int +} + +type TypeCache @cache(maxAge: 1000) { + a: Type @http(path: "/type-cache-a") + b: Type @http(path: "/type-cache-b") + list: [Type] @http(path: "/type-cache-list") +} diff --git a/tests/core/snapshots/call-graphql-datasource.md_0.snap b/tests/core/snapshots/call-graphql-datasource.md_0.snap new file mode 100644 index 0000000000..b4420e10c7 --- /dev/null +++ b/tests/core/snapshots/call-graphql-datasource.md_0.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "title": "a", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "b", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "c", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "d", + "user": { + "name": "Ervin Howell" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-graphql-datasource.md_client.snap b/tests/core/snapshots/call-graphql-datasource.md_client.snap new file mode 100644 index 0000000000..95d3e97b5f --- /dev/null +++ b/tests/core/snapshots/call-graphql-datasource.md_client.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String! + id: Int! + title: String! + user(id: Int): User + userId: Int! +} + +type Query { + posts: [Post] + user(id: Int!): User +} + +scalar Url + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/call-graphql-datasource.md_merged.snap b/tests/core/snapshots/call-graphql-datasource.md_merged.snap new file mode 100644 index 0000000000..ec344567c4 --- /dev/null +++ b/tests/core/snapshots/call-graphql-datasource.md_merged.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { + query: Query +} + +type Post { + body: String! + id: Int! + title: String! + user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts") + user(id: Int!): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") +} + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_0.snap b/tests/core/snapshots/call-multiple-steps-piping.md_0.snap new file mode 100644 index 0000000000..dc07f0ac53 --- /dev/null +++ b/tests/core/snapshots/call-multiple-steps-piping.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "abc_input": 3 + } + } +} diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_1.snap b/tests/core/snapshots/call-multiple-steps-piping.md_1.snap new file mode 100644 index 0000000000..dcd399b30f --- /dev/null +++ b/tests/core/snapshots/call-multiple-steps-piping.md_1.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "abc": 3 + } + } +} diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_client.snap b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap new file mode 100644 index 0000000000..deea0f695a --- /dev/null +++ b/tests/core/snapshots/call-multiple-steps-piping.md_client.snap @@ -0,0 +1,31 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + a(input: JSON): JSON + a_input(input: JSON): JSON + abc(input: JSON): JSON + abc_input(input: JSON): JSON + b(input: JSON): JSON + b_input(input: JSON): JSON + c(input: JSON): JSON + wrap_args: JSON + wrap_input(input: JSON): JSON +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap b/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap new file mode 100644 index 0000000000..d9d2d3a8ef --- /dev/null +++ b/tests/core/snapshots/call-multiple-steps-piping.md_merged.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + a(input: JSON): JSON @expr(body: "{{.args.input.a}}") + a_input(input: JSON): JSON @expr(body: {input: "{{.args.input.a}}"}) + abc(input: JSON): JSON @call(steps: [{query: "a", args: {input: "{{.args.input}}"}}, {query: "wrap_args"}, {query: "b"}, {query: "wrap_args"}, {query: "c"}]) + abc_input(input: JSON): JSON @call(steps: [{query: "wrap_input", args: {input: "{{.args.input}}"}}, {query: "a_input"}, {query: "wrap_input"}, {query: "b_input"}, {query: "wrap_input"}, {query: "c"}]) + b(input: JSON): JSON @expr(body: "{{.args.input.b}}") + b_input(input: JSON): JSON @expr(body: {input: "{{.args.input.b}}"}) + c(input: JSON): JSON @expr(body: "{{.args.input.c}}") + wrap_args: JSON @expr(body: {input: "{{.args}}"}) + wrap_input(input: JSON): JSON @expr(body: {input: "{{.args.input}}"}) +} diff --git a/tests/core/snapshots/call-mutation.md_0.snap b/tests/core/snapshots/call-mutation.md_0.snap new file mode 100644 index 0000000000..a0b72d835b --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "insertPost": { + "body": "post-body" + } + } + } +} diff --git a/tests/core/snapshots/call-mutation.md_1.snap b/tests/core/snapshots/call-mutation.md_1.snap new file mode 100644 index 0000000000..ac831dbf76 --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_1.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "posts": [ + { + "title": "post1-title" + }, + { + "title": "post2-title" + }, + { + "title": "post3-title" + } + ] + } + } + } +} diff --git a/tests/core/snapshots/call-mutation.md_2.snap b/tests/core/snapshots/call-mutation.md_2.snap new file mode 100644 index 0000000000..e2c0d0eb8a --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_2.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "attachPostToFirstUser": { + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/call-mutation.md_3.snap b/tests/core/snapshots/call-mutation.md_3.snap new file mode 100644 index 0000000000..2e8dd036cd --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_3.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "insertPostToFirstUser": { + "body": "post-body" + } + } + } +} diff --git a/tests/core/snapshots/call-mutation.md_4.snap b/tests/core/snapshots/call-mutation.md_4.snap new file mode 100644 index 0000000000..e082082e7d --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_4.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "insertMockedPost": { + "body": "post-body" + } + } + } +} diff --git a/tests/core/snapshots/call-mutation.md_client.snap b/tests/core/snapshots/call-mutation.md_client.snap new file mode 100644 index 0000000000..bea3b07d85 --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_client.snap @@ -0,0 +1,59 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + attachPostToFirstUser(postId: Int, userId: Int): User + attachPostToUser(postId: Int!, userId: Int!): User + insertMockedPost(input: PostInput): Post + insertPost(input: PostInput): Post + insertPostToFirstUser(input: PostInputWithoutUserId, userId: Int): Post + insertPostToUser(input: PostInputWithoutUserId!, userId: Int!): Post +} + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int +} + +input PostInput { + body: String + title: String + userId: Int +} + +input PostInputWithoutUserId { + body: String + title: String + userId: Int +} + +type Query { + firstUser: User + postFromUser(userId: Int!): Post +} + +scalar Url + +type User { + id: Int + name: String + posts(userId: Int): [Post] +} + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/call-mutation.md_merged.snap b/tests/core/snapshots/call-mutation.md_merged.snap new file mode 100644 index 0000000000..4684f682f2 --- /dev/null +++ b/tests/core/snapshots/call-mutation.md_merged.snap @@ -0,0 +1,47 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query + mutation: Mutation +} + +input PostInput { + body: String + title: String + userId: Int +} + +input PostInputWithoutUserId { + body: String + title: String + userId: Int +} + +type Mutation { + attachPostToFirstUser(postId: Int!): User @call(steps: [{mutation: "attachPostToUser", args: {postId: "{{.args.postId}}", userId: 1}}]) + attachPostToUser(postId: Int!, userId: Int!): User @http(body: "{\"postId\":{{.args.postId}}}", method: "PATCH", path: "/users/{{.args.userId}}") + insertMockedPost: Post @call(steps: [{mutation: "insertPost", args: {input: {body: "post-body", title: "post-title", userId: 1}}}]) + insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") + insertPostToFirstUser(input: PostInputWithoutUserId): Post @call(steps: [{mutation: "insertPostToUser", args: {input: "{{.args.input}}", userId: 1}}]) + insertPostToUser(input: PostInputWithoutUserId!, userId: Int!): Post @http(body: "{{.args.input}}", method: "POST", path: "/users/{{.args.userId}}/posts") +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + firstUser: User @http(path: "/users/1") + postFromUser(userId: Int!): Post @http(path: "/posts?userId={{.args.userId}}") +} + +type User { + id: Int + name: String + posts: [Post] @call(steps: [{query: "postFromUser", args: {userId: "{{.value.id}}"}}]) +} diff --git a/tests/core/snapshots/call-operator.md_0.snap b/tests/core/snapshots/call-operator.md_0.snap new file mode 100644 index 0000000000..70bb1cdebb --- /dev/null +++ b/tests/core/snapshots/call-operator.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user": { + "name": "foo" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_1.snap b/tests/core/snapshots/call-operator.md_1.snap new file mode 100644 index 0000000000..8b3a950db1 --- /dev/null +++ b/tests/core/snapshots/call-operator.md_1.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "user1": { + "name": "foo" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_10.snap b/tests/core/snapshots/call-operator.md_10.snap new file mode 100644 index 0000000000..87b277bf3c --- /dev/null +++ b/tests/core/snapshots/call-operator.md_10.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "news": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_11.snap b/tests/core/snapshots/call-operator.md_11.snap new file mode 100644 index 0000000000..e90dc644de --- /dev/null +++ b/tests/core/snapshots/call-operator.md_11.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "newsWithPortArg": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_12.snap b/tests/core/snapshots/call-operator.md_12.snap new file mode 100644 index 0000000000..c37773a9b8 --- /dev/null +++ b/tests/core/snapshots/call-operator.md_12.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "newsWithPortArg": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/call-operator.md_2.snap b/tests/core/snapshots/call-operator.md_2.snap new file mode 100644 index 0000000000..cd98048d91 --- /dev/null +++ b/tests/core/snapshots/call-operator.md_2.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "userFromValue": { + "name": "foo" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_3.snap b/tests/core/snapshots/call-operator.md_3.snap new file mode 100644 index 0000000000..00eff50b9a --- /dev/null +++ b/tests/core/snapshots/call-operator.md_3.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "userGraphQLHeaders": { + "name": "Leanne Graham" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_4.snap b/tests/core/snapshots/call-operator.md_4.snap new file mode 100644 index 0000000000..00eff50b9a --- /dev/null +++ b/tests/core/snapshots/call-operator.md_4.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "userGraphQLHeaders": { + "name": "Leanne Graham" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_5.snap b/tests/core/snapshots/call-operator.md_5.snap new file mode 100644 index 0000000000..806ab8a84d --- /dev/null +++ b/tests/core/snapshots/call-operator.md_5.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "userHttpHeaders": { + "name": "Leanne Graham http headers" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_6.snap b/tests/core/snapshots/call-operator.md_6.snap new file mode 100644 index 0000000000..660a3716c6 --- /dev/null +++ b/tests/core/snapshots/call-operator.md_6.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "userHttpQuery": { + "name": "Leanne Graham http query" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_7.snap b/tests/core/snapshots/call-operator.md_7.snap new file mode 100644 index 0000000000..226a9c3e3a --- /dev/null +++ b/tests/core/snapshots/call-operator.md_7.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "userPosts": [ + { + "title": "bar" + }, + { + "title": "qux" + } + ] + } + } +} diff --git a/tests/core/snapshots/call-operator.md_8.snap b/tests/core/snapshots/call-operator.md_8.snap new file mode 100644 index 0000000000..555ce24bfc --- /dev/null +++ b/tests/core/snapshots/call-operator.md_8.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "userWithPosts": { + "posts": [ + { + "title": "bar" + }, + { + "title": "qux" + } + ] + } + } + } +} diff --git a/tests/core/snapshots/call-operator.md_9.snap b/tests/core/snapshots/call-operator.md_9.snap new file mode 100644 index 0000000000..f4f2990d59 --- /dev/null +++ b/tests/core/snapshots/call-operator.md_9.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "news": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/call-operator.md_client.snap b/tests/core/snapshots/call-operator.md_client.snap new file mode 100644 index 0000000000..03ace5505d --- /dev/null +++ b/tests/core/snapshots/call-operator.md_client.snap @@ -0,0 +1,77 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +scalar PhoneNumber + +type Post { + body: String + id: Int + news: NewsData! + newsWithPortArg: NewsData! + title: String + user(id: Int): User + user1: User + userFromValue: User + userGraphQL(id: Int): User + userGraphQLHeaders(id: Int): User + userHttpHeaders(id: ID): User + userHttpQuery(id: ID): User + userId: Int! +} + +type Query { + news: NewsData! + newsWithPortArg(port: Int!): NewsData! + posts: [Post] + user(id: Int!): User + user1: User + userFromValue: User + userGraphQL(id: Int): User + userGraphQLHeaders(id: Int!): User + userHttpHeaders(id: ID!): User + userHttpQuery(id: ID!): User + userId: Int! + userPosts(id: ID!): [Post] + userWithPosts: UserWithPosts +} + +scalar Url + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} + +type UserWithPosts { + id: Int! + name: String! + posts(id: ID): [Post] +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/call-operator.md_merged.snap b/tests/core/snapshots/call-operator.md_merged.snap new file mode 100644 index 0000000000..ad316db56f --- /dev/null +++ b/tests/core/snapshots/call-operator.md_merged.snap @@ -0,0 +1,65 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Post { + body: String + id: Int + news: NewsData! @call(steps: [{query: "news"}]) + newsWithPortArg: NewsData! @call(steps: [{query: "news", args: {port: 50051}}]) + title: String + user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) + user1: User @call(steps: [{query: "user1"}]) + userFromValue: User @call(steps: [{query: "userFromValue"}]) + userGraphQL: User @call(steps: [{query: "userGraphQL", args: {id: "{{.value.userId}}"}}]) + userGraphQLHeaders: User @call(steps: [{query: "userGraphQLHeaders", args: {id: "{{.value.userId}}"}}]) + userHttpHeaders: User @call(steps: [{query: "userHttpHeaders", args: {id: "{{.value.userId}}"}}]) + userHttpQuery: User @call(steps: [{query: "userHttpQuery", args: {id: "{{.value.userId}}"}}]) + userId: Int! +} + +type Query { + news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") + newsWithPortArg(port: Int!): NewsData! @grpc(baseURL: "http://localhost:{{.args.port}}", method: "news.NewsService.GetAllNews") + posts: [Post] @http(path: "/posts") + user(id: Int!): User @http(path: "/users/{{.args.id}}") + user1: User @http(path: "/users/1") + userFromValue: User @http(path: "/users/{{.value.userId}}") + userGraphQL(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") + userGraphQLHeaders(id: Int!): User @graphQL(baseURL: "http://upstream/graphql", headers: [{key: "id", value: "{{.args.id}}"}], name: "user") + userHttpHeaders(id: ID!): User @http(headers: [{key: "id", value: "{{.args.id}}"}], path: "/users") + userHttpQuery(id: ID!): User @http(path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) + userId: Int! @expr(body: 2) + userPosts(id: ID!): [Post] @http(path: "/posts", query: [{key: "userId", value: "{{.args.id}}"}]) + userWithPosts: UserWithPosts @http(path: "/users/1") +} + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} + +type UserWithPosts { + id: Int! + name: String! + posts: [Post] @call(steps: [{query: "userPosts", args: {id: "{{.value.id}}"}}]) +} diff --git a/tests/core/snapshots/cors-allow-cred-false.md_0.snap b/tests/core/snapshots/cors-allow-cred-false.md_0.snap new file mode 100644 index 0000000000..396411301d --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-false.md_0.snap @@ -0,0 +1,14 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "access-control-allow-headers": "Authorization", + "access-control-allow-methods": "POST, OPTIONS", + "access-control-max-age": "23", + "vary": "origin, access-control-request-method, access-control-request-headers" + }, + "body": null +} diff --git a/tests/core/snapshots/cors-allow-cred-false.md_client.snap b/tests/core/snapshots/cors-allow-cred-false.md_client.snap new file mode 100644 index 0000000000..de202e546c --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-false.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + val: Int +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/cors-allow-cred-false.md_merged.snap b/tests/core/snapshots/cors-allow-cred-false.md_merged.snap new file mode 100644 index 0000000000..3d1469055a --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-false.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {cors: {allowHeaders: ["Authorization"], allowMethods: ["POST", "OPTIONS"], allowOrigins: ["abc.com", "xyz.com"], allowPrivateNetwork: true, maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Query { + val: Int @expr(body: 1) +} diff --git a/tests/core/snapshots/cors-allow-cred-true.md_0.snap b/tests/core/snapshots/cors-allow-cred-true.md_0.snap new file mode 100644 index 0000000000..0d277c5d44 --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-true.md_0.snap @@ -0,0 +1,14 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "access-control-allow-credentials": "true", + "access-control-allow-methods": "OPTIONS, POST, GET", + "access-control-max-age": "23", + "vary": "origin, access-control-request-method, access-control-request-headers" + }, + "body": null +} diff --git a/tests/core/snapshots/cors-allow-cred-true.md_client.snap b/tests/core/snapshots/cors-allow-cred-true.md_client.snap new file mode 100644 index 0000000000..de202e546c --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-true.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + val: Int +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/cors-allow-cred-true.md_merged.snap b/tests/core/snapshots/cors-allow-cred-true.md_merged.snap new file mode 100644 index 0000000000..93e6b8bb82 --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-true.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {cors: {allowCredentials: true, allowMethods: ["OPTIONS", "POST", "GET"], allowOrigins: ["abc.com", "xyz.com"], exposeHeaders: [""], maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Query { + val: Int @expr(body: 1) +} diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_0.snap b/tests/core/snapshots/cors-allow-cred-vary.md_0.snap new file mode 100644 index 0000000000..027484ed4f --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-vary.md_0.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "access-control-allow-credentials": "true", + "access-control-expose-headers": "", + "content-type": "application/json", + "vary": "origin, access-control-request-method, access-control-request-headers" + }, + "body": { + "data": { + "val": 1 + } + } +} diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_client.snap b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap new file mode 100644 index 0000000000..de202e546c --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-vary.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + val: Int +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap b/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap new file mode 100644 index 0000000000..93e6b8bb82 --- /dev/null +++ b/tests/core/snapshots/cors-allow-cred-vary.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {cors: {allowCredentials: true, allowMethods: ["OPTIONS", "POST", "GET"], allowOrigins: ["abc.com", "xyz.com"], exposeHeaders: [""], maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Query { + val: Int @expr(body: 1) +} diff --git a/tests/core/snapshots/custom-headers.md_0.snap b/tests/core/snapshots/custom-headers.md_0.snap new file mode 100644 index 0000000000..4dc49a862b --- /dev/null +++ b/tests/core/snapshots/custom-headers.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json", + "x-id": "1", + "x-name": "John Doe" + }, + "body": { + "data": { + "greet": "Hello World!" + } + } +} diff --git a/tests/core/snapshots/custom-headers.md_client.snap b/tests/core/snapshots/custom-headers.md_client.snap new file mode 100644 index 0000000000..ac555c1a8a --- /dev/null +++ b/tests/core/snapshots/custom-headers.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + greet: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/custom-headers.md_merged.snap b/tests/core/snapshots/custom-headers.md_merged.snap new file mode 100644 index 0000000000..9ef0fa4ce6 --- /dev/null +++ b/tests/core/snapshots/custom-headers.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {custom: [{key: "x-id", value: "1"}, {key: "x-name", value: "John Doe"}]}) @upstream { + query: Query +} + +type Query { + greet: String @expr(body: "Hello World!") +} diff --git a/tests/core/snapshots/env-value.md_0.snap b/tests/core/snapshots/env-value.md_0.snap new file mode 100644 index 0000000000..2c2d8a3107 --- /dev/null +++ b/tests/core/snapshots/env-value.md_0.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "post1": { + "id": 1, + "title": "Post 1", + "body": "Post 1 body", + "userId": 1 + }, + "post2": { + "id": 2, + "title": "Post 2", + "body": "Post 2 body", + "userId": 2 + }, + "post3": { + "id": 3, + "title": "Post 3", + "body": "Post 3 body", + "userId": 3 + } + } + } +} diff --git a/tests/core/snapshots/env-value.md_client.snap b/tests/core/snapshots/env-value.md_client.snap new file mode 100644 index 0000000000..17da57e235 --- /dev/null +++ b/tests/core/snapshots/env-value.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int! +} + +type Query { + post1: Post + post2: Post + post3: Post +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/env-value.md_merged.snap b/tests/core/snapshots/env-value.md_merged.snap new file mode 100644 index 0000000000..bd648ec48a --- /dev/null +++ b/tests/core/snapshots/env-value.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Post { + body: String + id: Int + title: String + userId: Int! +} + +type Query { + post1: Post @http(path: "/posts/{{.env.ID}}") + post2: Post @http(path: "/posts/{{.env.POST_ID}}") + post3: Post @http(path: "/posts/{{.env.NESTED_POST_ID}}") +} diff --git a/tests/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap b/tests/core/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap similarity index 87% rename from tests/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap rename to tests/core/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap index d0e4e6a07e..7330dede2f 100644 --- a/tests/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap +++ b/tests/core/snapshots/execution_spec__auth-protected-without-auth.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap b/tests/core/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap rename to tests/core/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap index de6cc86eaf..746e69d015 100644 --- a/tests/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap +++ b/tests/core/snapshots/execution_spec__cors-invalid-expose-headers.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__cors-invalid-headers.md_errors.snap b/tests/core/snapshots/execution_spec__cors-invalid-headers.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__cors-invalid-headers.md_errors.snap rename to tests/core/snapshots/execution_spec__cors-invalid-headers.md_errors.snap index 8e53f12774..581594e0b9 100644 --- a/tests/snapshots/execution_spec__cors-invalid-headers.md_errors.snap +++ b/tests/core/snapshots/execution_spec__cors-invalid-headers.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__cors-invalid-methods.md_errors.snap b/tests/core/snapshots/execution_spec__cors-invalid-methods.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__cors-invalid-methods.md_errors.snap rename to tests/core/snapshots/execution_spec__cors-invalid-methods.md_errors.snap index 67f1a0067c..f4c9b4b2f7 100644 --- a/tests/snapshots/execution_spec__cors-invalid-methods.md_errors.snap +++ b/tests/core/snapshots/execution_spec__cors-invalid-methods.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__cors-invalid-origins.md_errors.snap b/tests/core/snapshots/execution_spec__cors-invalid-origins.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__cors-invalid-origins.md_errors.snap rename to tests/core/snapshots/execution_spec__cors-invalid-origins.md_errors.snap index 6f2ad8bacb..d8799954bb 100644 --- a/tests/snapshots/execution_spec__cors-invalid-origins.md_errors.snap +++ b/tests/core/snapshots/execution_spec__cors-invalid-origins.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__experimental-headers-error.md_errors.snap b/tests/core/snapshots/execution_spec__experimental-headers-error.md_errors.snap similarity index 96% rename from tests/snapshots/execution_spec__experimental-headers-error.md_errors.snap rename to tests/core/snapshots/execution_spec__experimental-headers-error.md_errors.snap index 4fedc6112a..ec99849386 100644 --- a/tests/snapshots/execution_spec__experimental-headers-error.md_errors.snap +++ b/tests/core/snapshots/execution_spec__experimental-headers-error.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__input-type-protected-error.md_errors.snap b/tests/core/snapshots/execution_spec__input-type-protected-error.md_errors.snap similarity index 91% rename from tests/snapshots/execution_spec__input-type-protected-error.md_errors.snap rename to tests/core/snapshots/execution_spec__input-type-protected-error.md_errors.snap index eebe6efca2..e09e747a24 100644 --- a/tests/snapshots/execution_spec__input-type-protected-error.md_errors.snap +++ b/tests/core/snapshots/execution_spec__input-type-protected-error.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-add-field-error.md_errors.snap b/tests/core/snapshots/execution_spec__test-add-field-error.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-add-field-error.md_errors.snap rename to tests/core/snapshots/execution_spec__test-add-field-error.md_errors.snap index e45af7b013..7a9527f963 100644 --- a/tests/snapshots/execution_spec__test-add-field-error.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-add-field-error.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap b/tests/core/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap similarity index 94% rename from tests/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap rename to tests/core/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap index f2633f4d1b..3c93b4b9e6 100644 --- a/tests/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-all-blueprint-errors.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-batch-operator-post.md_errors.snap b/tests/core/snapshots/execution_spec__test-batch-operator-post.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-batch-operator-post.md_errors.snap rename to tests/core/snapshots/execution_spec__test-batch-operator-post.md_errors.snap index f2dc1a4b64..3ac6e3e721 100644 --- a/tests/snapshots/execution_spec__test-batch-operator-post.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-batch-operator-post.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-call-operator-errors.md_errors.snap b/tests/core/snapshots/execution_spec__test-call-operator-errors.md_errors.snap similarity index 97% rename from tests/snapshots/execution_spec__test-call-operator-errors.md_errors.snap rename to tests/core/snapshots/execution_spec__test-call-operator-errors.md_errors.snap index f15ff3cc55..98a5f21455 100644 --- a/tests/snapshots/execution_spec__test-call-operator-errors.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-call-operator-errors.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap b/tests/core/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap similarity index 89% rename from tests/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap rename to tests/core/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap index 47857501de..80e4e564e2 100644 --- a/tests/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-dbl-usage-many.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-dbl-usage.md_errors.snap b/tests/core/snapshots/execution_spec__test-dbl-usage.md_errors.snap similarity index 82% rename from tests/snapshots/execution_spec__test-dbl-usage.md_errors.snap rename to tests/core/snapshots/execution_spec__test-dbl-usage.md_errors.snap index 6d918ea3e7..421e08ba6a 100644 --- a/tests/snapshots/execution_spec__test-dbl-usage.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-dbl-usage.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap b/tests/core/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap similarity index 98% rename from tests/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap rename to tests/core/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap index bcae45f721..adb506ebde 100644 --- a/tests/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-directives-undef-null-fields.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-duplicated-link.md_errors.snap b/tests/core/snapshots/execution_spec__test-duplicated-link.md_errors.snap similarity index 94% rename from tests/snapshots/execution_spec__test-duplicated-link.md_errors.snap rename to tests/core/snapshots/execution_spec__test-duplicated-link.md_errors.snap index f8b2bc554d..3f990dc863 100644 --- a/tests/snapshots/execution_spec__test-duplicated-link.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-duplicated-link.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-empty-link.md_errors.snap b/tests/core/snapshots/execution_spec__test-empty-link.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__test-empty-link.md_errors.snap rename to tests/core/snapshots/execution_spec__test-empty-link.md_errors.snap index b993f4b651..6ee4deb1d6 100644 --- a/tests/snapshots/execution_spec__test-empty-link.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-empty-link.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-expr-error.md_errors.snap b/tests/core/snapshots/execution_spec__test-expr-error.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-expr-error.md_errors.snap rename to tests/core/snapshots/execution_spec__test-expr-error.md_errors.snap index cabe555d2b..cb7db5f40f 100644 --- a/tests/snapshots/execution_spec__test-expr-error.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-expr-error.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap b/tests/core/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap rename to tests/core/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap index fc73329a0b..0d8830eac9 100644 --- a/tests/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-expr-with-add-field.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-expr-with-inline.md_errors.snap b/tests/core/snapshots/execution_spec__test-expr-with-inline.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-expr-with-inline.md_errors.snap rename to tests/core/snapshots/execution_spec__test-expr-with-inline.md_errors.snap index fc73329a0b..0d8830eac9 100644 --- a/tests/snapshots/execution_spec__test-expr-with-inline.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-expr-with-inline.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap b/tests/core/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap similarity index 94% rename from tests/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap rename to tests/core/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap index c4b553e388..e0af5a9a50 100644 --- a/tests/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-field-already-implemented-from-Interface.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap b/tests/core/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap similarity index 84% rename from tests/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap rename to tests/core/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap index bc36b86753..852880f9b7 100644 --- a/tests/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-graphqlsource-no-base-url.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap b/tests/core/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap rename to tests/core/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap index c9ef38fe04..4a3c7ded8c 100644 --- a/tests/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-groupby-without-batching.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-group-by.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-group-by.md_errors.snap similarity index 84% rename from tests/snapshots/execution_spec__test-grpc-group-by.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-group-by.md_errors.snap index e3e33bf635..a4356bd249 100644 --- a/tests/snapshots/execution_spec__test-grpc-group-by.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-group-by.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap similarity index 87% rename from tests/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap index 7b685f0d1f..c2ca8b345f 100644 --- a/tests/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-invalid-method-format.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap index 3aa8391073..36ee7add79 100644 --- a/tests/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-invalid-proto-id.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap index dc4ebb9de1..cdde712544 100644 --- a/tests/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-missing-fields.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap index bd11735e2e..b9d433c606 100644 --- a/tests/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-nested-data.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap index fe84415c1b..ab65e0dab1 100644 --- a/tests/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-nested-optional.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-optional.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-optional.md_errors.snap similarity index 85% rename from tests/snapshots/execution_spec__test-grpc-optional.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-optional.md_errors.snap index 3cdfc67390..6b515cedaf 100644 --- a/tests/snapshots/execution_spec__test-grpc-optional.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-optional.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap similarity index 81% rename from tests/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap index 17bddadb47..34febb43e4 100644 --- a/tests/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-proto-path.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-service-method.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-service-method.md_errors.snap similarity index 84% rename from tests/snapshots/execution_spec__test-grpc-service-method.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-service-method.md_errors.snap index 04fdd54c29..95599fc658 100644 --- a/tests/snapshots/execution_spec__test-grpc-service-method.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-service-method.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-grpc-service.md_errors.snap b/tests/core/snapshots/execution_spec__test-grpc-service.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-grpc-service.md_errors.snap rename to tests/core/snapshots/execution_spec__test-grpc-service.md_errors.snap index 42cbd1e0b1..269001ba60 100644 --- a/tests/snapshots/execution_spec__test-grpc-service.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-grpc-service.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-hostname-faliure.md_errors.snap b/tests/core/snapshots/execution_spec__test-hostname-faliure.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-hostname-faliure.md_errors.snap rename to tests/core/snapshots/execution_spec__test-hostname-faliure.md_errors.snap index 8b0b7b6c27..2c6ac4d613 100644 --- a/tests/snapshots/execution_spec__test-hostname-faliure.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-hostname-faliure.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-http-with-add-field.md_errors.snap b/tests/core/snapshots/execution_spec__test-http-with-add-field.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-http-with-add-field.md_errors.snap rename to tests/core/snapshots/execution_spec__test-http-with-add-field.md_errors.snap index 017b01bafc..f1751bc827 100644 --- a/tests/snapshots/execution_spec__test-http-with-add-field.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-http-with-add-field.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-http-with-inline.md_errors.snap b/tests/core/snapshots/execution_spec__test-http-with-inline.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-http-with-inline.md_errors.snap rename to tests/core/snapshots/execution_spec__test-http-with-inline.md_errors.snap index 017b01bafc..f1751bc827 100644 --- a/tests/snapshots/execution_spec__test-http-with-inline.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-http-with-inline.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-inline-error.md_errors.snap b/tests/core/snapshots/execution_spec__test-inline-error.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-inline-error.md_errors.snap rename to tests/core/snapshots/execution_spec__test-inline-error.md_errors.snap index e45af7b013..7a9527f963 100644 --- a/tests/snapshots/execution_spec__test-inline-error.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-inline-error.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap b/tests/core/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap rename to tests/core/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap index fa5aebd26e..0f574af714 100644 --- a/tests/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-invalid-query-in-http.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-invalid-server.md_errors.snap b/tests/core/snapshots/execution_spec__test-invalid-server.md_errors.snap similarity index 86% rename from tests/snapshots/execution_spec__test-invalid-server.md_errors.snap rename to tests/core/snapshots/execution_spec__test-invalid-server.md_errors.snap index 57ecd5ae61..07613bc3f8 100644 --- a/tests/snapshots/execution_spec__test-invalid-server.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-invalid-server.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap b/tests/core/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap similarity index 83% rename from tests/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap rename to tests/core/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap index 206a18f222..8dd40ad345 100644 --- a/tests/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-js-multiple-scripts.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-lack-resolver.md_errors.snap b/tests/core/snapshots/execution_spec__test-lack-resolver.md_errors.snap similarity index 84% rename from tests/snapshots/execution_spec__test-lack-resolver.md_errors.snap rename to tests/core/snapshots/execution_spec__test-lack-resolver.md_errors.snap index 871cee918c..e3e60e1cbf 100644 --- a/tests/snapshots/execution_spec__test-lack-resolver.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-lack-resolver.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap b/tests/core/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap similarity index 96% rename from tests/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap rename to tests/core/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap index a6a5f3d206..bd0885307f 100644 --- a/tests/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-missing-argument-on-all-resolvers.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap b/tests/core/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap similarity index 84% rename from tests/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap rename to tests/core/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap index 3966a45d53..dd5c76b19e 100644 --- a/tests/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-missing-mutation-resolver.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap b/tests/core/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap rename to tests/core/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap index 6187eac79e..f1ee6ca5be 100644 --- a/tests/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-missing-query-resolver.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-missing-root-types.md_errors.snap b/tests/core/snapshots/execution_spec__test-missing-root-types.md_errors.snap similarity index 89% rename from tests/snapshots/execution_spec__test-missing-root-types.md_errors.snap rename to tests/core/snapshots/execution_spec__test-missing-root-types.md_errors.snap index c869459b6a..60b7f03d34 100644 --- a/tests/snapshots/execution_spec__test-missing-root-types.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-missing-root-types.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-missing-schema-query.md_errors.snap b/tests/core/snapshots/execution_spec__test-missing-schema-query.md_errors.snap similarity index 81% rename from tests/snapshots/execution_spec__test-missing-schema-query.md_errors.snap rename to tests/core/snapshots/execution_spec__test-missing-schema-query.md_errors.snap index f416522410..1ef6c7ae5c 100644 --- a/tests/snapshots/execution_spec__test-missing-schema-query.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-missing-schema-query.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap b/tests/core/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap rename to tests/core/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap index fb1240fd5f..7e7969e515 100644 --- a/tests/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-multiple-resolvable-directives-on-field.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-no-base-url.md_errors.snap b/tests/core/snapshots/execution_spec__test-no-base-url.md_errors.snap similarity index 83% rename from tests/snapshots/execution_spec__test-no-base-url.md_errors.snap rename to tests/core/snapshots/execution_spec__test-no-base-url.md_errors.snap index 06ed886ca0..0414d880a4 100644 --- a/tests/snapshots/execution_spec__test-no-base-url.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-no-base-url.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-response-header-value.md_errors.snap b/tests/core/snapshots/execution_spec__test-response-header-value.md_errors.snap similarity index 87% rename from tests/snapshots/execution_spec__test-response-header-value.md_errors.snap rename to tests/core/snapshots/execution_spec__test-response-header-value.md_errors.snap index e525f70886..d319669132 100644 --- a/tests/snapshots/execution_spec__test-response-header-value.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-response-header-value.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-response-headers-multi.md_errors.snap b/tests/core/snapshots/execution_spec__test-response-headers-multi.md_errors.snap similarity index 96% rename from tests/snapshots/execution_spec__test-response-headers-multi.md_errors.snap rename to tests/core/snapshots/execution_spec__test-response-headers-multi.md_errors.snap index d12fe47ea0..e7de957c9f 100644 --- a/tests/snapshots/execution_spec__test-response-headers-multi.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-response-headers-multi.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-response-headers-name.md_errors.snap b/tests/core/snapshots/execution_spec__test-response-headers-name.md_errors.snap similarity index 87% rename from tests/snapshots/execution_spec__test-response-headers-name.md_errors.snap rename to tests/core/snapshots/execution_spec__test-response-headers-name.md_errors.snap index 29374aeb1d..a611958fd3 100644 --- a/tests/snapshots/execution_spec__test-response-headers-name.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-response-headers-name.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__test-undefined-query.md_errors.snap b/tests/core/snapshots/execution_spec__test-undefined-query.md_errors.snap similarity index 95% rename from tests/snapshots/execution_spec__test-undefined-query.md_errors.snap rename to tests/core/snapshots/execution_spec__test-undefined-query.md_errors.snap index 8460380609..bb7fe8faa3 100644 --- a/tests/snapshots/execution_spec__test-undefined-query.md_errors.snap +++ b/tests/core/snapshots/execution_spec__test-undefined-query.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap b/tests/core/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap similarity index 90% rename from tests/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap rename to tests/core/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap index cc4954cc2b..ac8d461198 100644 --- a/tests/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap +++ b/tests/core/snapshots/execution_spec__undeclared-type-no-base-url.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/snapshots/execution_spec__undeclared-type.md_errors.snap b/tests/core/snapshots/execution_spec__undeclared-type.md_errors.snap similarity index 83% rename from tests/snapshots/execution_spec__undeclared-type.md_errors.snap rename to tests/core/snapshots/execution_spec__undeclared-type.md_errors.snap index e345dd5eb6..fe591d2f33 100644 --- a/tests/snapshots/execution_spec__undeclared-type.md_errors.snap +++ b/tests/core/snapshots/execution_spec__undeclared-type.md_errors.snap @@ -1,5 +1,5 @@ --- -source: tests/execution_spec.rs +source: tests/core/spec.rs expression: errors --- [ diff --git a/tests/core/snapshots/experimental-headers.md_0.snap b/tests/core/snapshots/experimental-headers.md_0.snap new file mode 100644 index 0000000000..559c15b572 --- /dev/null +++ b/tests/core/snapshots/experimental-headers.md_0.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json", + "x-experimental": "experimental-header", + "x-tailcall": "tailcall-header" + }, + "body": { + "data": { + "users": [ + { + "id": 1, + "name": "Leanne Graham" + } + ] + } + } +} diff --git a/tests/core/snapshots/experimental-headers.md_client.snap b/tests/core/snapshots/experimental-headers.md_client.snap new file mode 100644 index 0000000000..9561d92458 --- /dev/null +++ b/tests/core/snapshots/experimental-headers.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + users: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/experimental-headers.md_merged.snap b/tests/core/snapshots/experimental-headers.md_merged.snap new file mode 100644 index 0000000000..9fdcd5e3d0 --- /dev/null +++ b/tests/core/snapshots/experimental-headers.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {experimental: ["X-experimental", "x-tailcall"]}) @upstream { + query: Query +} + +type Query { + users: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap new file mode 100644 index 0000000000..b4420e10c7 --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_0.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "title": "a", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "b", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "c", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "d", + "user": { + "name": "Ervin Howell" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap new file mode 100644 index 0000000000..1b6afcdb98 --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_client.snap @@ -0,0 +1,35 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int + title: String + user: User + userId: Int +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap b/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap new file mode 100644 index 0000000000..2f76478dfa --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-batch-request.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(batch: {delay: 1, headers: []}) { + query: Query +} + +type Post { + id: Int + title: String + user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], baseURL: "http://upstream/graphql", batch: true, name: "user") + userId: Int +} + +type Query { + posts: [Post] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap new file mode 100644 index 0000000000..b4420e10c7 --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_0.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "title": "a", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "b", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "c", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "d", + "user": { + "name": "Ervin Howell" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap new file mode 100644 index 0000000000..1b6afcdb98 --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_client.snap @@ -0,0 +1,35 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int + title: String + user: User + userId: Int +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap new file mode 100644 index 0000000000..16af3a561a --- /dev/null +++ b/tests/core/snapshots/graphql-dataloader-no-batch-request.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(batch: {delay: 1, headers: []}) { + query: Query +} + +type Post { + id: Int + title: String + user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], baseURL: "http://upstream/graphql", name: "user") + userId: Int +} + +type Query { + posts: [Post] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-datasource-errors.md_0.snap b/tests/core/snapshots/graphql-datasource-errors.md_0.snap new file mode 100644 index 0000000000..a14dce54cb --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-errors.md_0.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": null + }, + "errors": [ + { + "message": "Failed to resolve user", + "locations": [ + { + "line": 1, + "column": 9 + } + ], + "path": [ + "user" + ] + } + ] + } +} diff --git a/tests/core/snapshots/graphql-datasource-errors.md_1.snap b/tests/core/snapshots/graphql-datasource-errors.md_1.snap new file mode 100644 index 0000000000..02f11ae658 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-errors.md_1.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": null, + "id": 2 + } + }, + "errors": [ + { + "message": "Failed to resolve name", + "locations": [ + { + "line": 1, + "column": 35 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/graphql-datasource-errors.md_client.snap b/tests/core/snapshots/graphql-datasource-errors.md_client.snap new file mode 100644 index 0000000000..7c0bdf72e9 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-errors.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-datasource-errors.md_merged.snap b/tests/core/snapshots/graphql-datasource-errors.md_merged.snap new file mode 100644 index 0000000000..8dfbfa8b10 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-errors.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + user(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_0.snap b/tests/core/snapshots/graphql-datasource-mutation.md_0.snap new file mode 100644 index 0000000000..4a1861c0e1 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-mutation.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "createUser": { + "name": "Test Name" + } + } + } +} diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_client.snap b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap new file mode 100644 index 0000000000..8e51a31357 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-mutation.md_client.snap @@ -0,0 +1,39 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + createUser(user: UserInput!): User +} + +scalar PhoneNumber + +type Query { + users: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +input UserInput { + email: String! + name: String! + phone: String +} + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap b/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap new file mode 100644 index 0000000000..3cd8c33c5b --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-mutation.md_merged.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query + mutation: Mutation +} + +input UserInput { + email: String! + name: String! + phone: String +} + +type Mutation { + createUser(user: UserInput!): User @graphQL(args: [{key: "user", value: "{{.args.user}}"}], baseURL: "http://upstream/graphql", name: "createUser") +} + +type Query { + users: [User] @graphQL(baseURL: "http://upstream/graphql", name: "users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_0.snap b/tests/core/snapshots/graphql-datasource-no-args.md_0.snap new file mode 100644 index 0000000000..d4d493733f --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-no-args.md_0.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users_list": [ + { + "name": "Leanne Graham" + }, + { + "name": "Ervin Howell" + } + ] + } + } +} diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_client.snap b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap new file mode 100644 index 0000000000..a9b226f953 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-no-args.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + users_list: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap b/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap new file mode 100644 index 0000000000..c43eb701d7 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-no-args.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + users_list: [User] @graphQL(baseURL: "http://upstream/graphql", name: "users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_0.snap b/tests/core/snapshots/graphql-datasource-with-args.md_0.snap new file mode 100644 index 0000000000..27bf57106e --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-with-args.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "Leanne Graham" + } + } + } +} diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_1.snap b/tests/core/snapshots/graphql-datasource-with-args.md_1.snap new file mode 100644 index 0000000000..ccb0082d47 --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-with-args.md_1.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "post": { + "id": 1, + "user": { + "name": "Leanne Graham" + } + } + } + } +} diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_client.snap b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap new file mode 100644 index 0000000000..692a59db2d --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-with-args.md_client.snap @@ -0,0 +1,34 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int + user: User +} + +type Query { + post(id: Int): Post + user(id: Int): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap b/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap new file mode 100644 index 0000000000..e84cc42c8a --- /dev/null +++ b/tests/core/snapshots/graphql-datasource-with-args.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Post { + id: Int + user: User +} + +type Query { + post(id: Int): Post @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "post") + user(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/grpc-batch.md_0.snap b/tests/core/snapshots/grpc-batch.md_0.snap new file mode 100644 index 0000000000..7239944846 --- /dev/null +++ b/tests/core/snapshots/grpc-batch.md_0.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "newsById2": { + "title": "Note 2" + }, + "newsById3": { + "title": "Note 3" + } + } + } +} diff --git a/tests/core/snapshots/grpc-batch.md_client.snap b/tests/core/snapshots/grpc-batch.md_client.snap new file mode 100644 index 0000000000..da34171517 --- /dev/null +++ b/tests/core/snapshots/grpc-batch.md_client.snap @@ -0,0 +1,42 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-batch.md_merged.snap b/tests/core/snapshots/grpc-batch.md_merged.snap new file mode 100644 index 0000000000..14626ab137 --- /dev/null +++ b/tests/core/snapshots/grpc-batch.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", batchKey: ["news", "id"], method: "news.NewsService.GetMultipleNews") +} diff --git a/tests/core/snapshots/grpc-error.md_0.snap b/tests/core/snapshots/grpc-error.md_0.snap new file mode 100644 index 0000000000..e69720283c --- /dev/null +++ b/tests/core/snapshots/grpc-error.md_0.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "gRPC Error: status: 3, description: `Client specified an invalid argument`, message: `grpc message`", + "locations": [ + { + "line": 1, + "column": 9 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/grpc-error.md_client.snap b/tests/core/snapshots/grpc-error.md_client.snap new file mode 100644 index 0000000000..da34171517 --- /dev/null +++ b/tests/core/snapshots/grpc-error.md_client.snap @@ -0,0 +1,42 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-error.md_merged.snap b/tests/core/snapshots/grpc-error.md_merged.snap new file mode 100644 index 0000000000..54e5f0b144 --- /dev/null +++ b/tests/core/snapshots/grpc-error.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") +} diff --git a/tests/core/snapshots/grpc-override-url-from-upstream.md_0.snap b/tests/core/snapshots/grpc-override-url-from-upstream.md_0.snap new file mode 100644 index 0000000000..f4f2990d59 --- /dev/null +++ b/tests/core/snapshots/grpc-override-url-from-upstream.md_0.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "news": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap b/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap new file mode 100644 index 0000000000..da34171517 --- /dev/null +++ b/tests/core/snapshots/grpc-override-url-from-upstream.md_client.snap @@ -0,0 +1,42 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap b/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap new file mode 100644 index 0000000000..a42f6b7991 --- /dev/null +++ b/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://not-a-valid-grpc-url.com", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") +} diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap new file mode 100644 index 0000000000..faaf53b6bd --- /dev/null +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_0.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "foo": { + "foo": "test-foo" + }, + "bar": { + "bar": "test-bar" + } + } + } +} diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap new file mode 100644 index 0000000000..4629912e16 --- /dev/null +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + bar: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + foo: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bar: Bar! + foo: Foo! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap new file mode 100644 index 0000000000..885b23f062 --- /dev/null +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051") @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { + query: Query +} + +type Bar { + bar: String +} + +type Foo { + foo: String +} + +type Query { + bar: Bar! @grpc(method: "test.BarService.GetBar") + foo: Foo! @grpc(method: "test.FooService.GetFoo") +} diff --git a/tests/core/snapshots/grpc-simple.md_0.snap b/tests/core/snapshots/grpc-simple.md_0.snap new file mode 100644 index 0000000000..f4f2990d59 --- /dev/null +++ b/tests/core/snapshots/grpc-simple.md_0.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "news": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/grpc-simple.md_client.snap b/tests/core/snapshots/grpc-simple.md_client.snap new file mode 100644 index 0000000000..da34171517 --- /dev/null +++ b/tests/core/snapshots/grpc-simple.md_client.snap @@ -0,0 +1,42 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-simple.md_merged.snap b/tests/core/snapshots/grpc-simple.md_merged.snap new file mode 100644 index 0000000000..54e5f0b144 --- /dev/null +++ b/tests/core/snapshots/grpc-simple.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") +} diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_0.snap b/tests/core/snapshots/grpc-url-from-upstream.md_0.snap new file mode 100644 index 0000000000..f4f2990d59 --- /dev/null +++ b/tests/core/snapshots/grpc-url-from-upstream.md_0.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "news": { + "news": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + } + } +} diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_client.snap b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap new file mode 100644 index 0000000000..da34171517 --- /dev/null +++ b/tests/core/snapshots/grpc-url-from-upstream.md_client.snap @@ -0,0 +1,42 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap new file mode 100644 index 0000000000..0ad2090a9f --- /dev/null +++ b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") +} diff --git a/tests/core/snapshots/https.md_0.snap b/tests/core/snapshots/https.md_0.snap new file mode 100644 index 0000000000..a085a7c561 --- /dev/null +++ b/tests/core/snapshots/https.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "name": "Leanne Graham" + } + } + } +} diff --git a/tests/core/snapshots/https.md_client.snap b/tests/core/snapshots/https.md_client.snap new file mode 100644 index 0000000000..fd73bea4ae --- /dev/null +++ b/tests/core/snapshots/https.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/https.md_merged.snap b/tests/core/snapshots/https.md_merged.snap new file mode 100644 index 0000000000..68c4914d04 --- /dev/null +++ b/tests/core/snapshots/https.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + firstUser: User @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/inline-field.md_0.snap b/tests/core/snapshots/inline-field.md_0.snap new file mode 100644 index 0000000000..9b27f8fefd --- /dev/null +++ b/tests/core/snapshots/inline-field.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "address": "-37.3159" + } + } + } +} diff --git a/tests/core/snapshots/inline-field.md_client.snap b/tests/core/snapshots/inline-field.md_client.snap new file mode 100644 index 0000000000..db581c1494 --- /dev/null +++ b/tests/core/snapshots/inline-field.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/inline-field.md_merged.snap b/tests/core/snapshots/inline-field.md_merged.snap new file mode 100644 index 0000000000..7251879bf9 --- /dev/null +++ b/tests/core/snapshots/inline-field.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + geo: Geo +} + +type Geo { + lat: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "address", path: ["address", "geo", "lat"]) { + address: Address @modify(omit: true) +} diff --git a/tests/core/snapshots/inline-index-list.md_0.snap b/tests/core/snapshots/inline-index-list.md_0.snap new file mode 100644 index 0000000000..a5b7c188b6 --- /dev/null +++ b/tests/core/snapshots/inline-index-list.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "username": "Leanne Graham" + } + } +} diff --git a/tests/core/snapshots/inline-index-list.md_client.snap b/tests/core/snapshots/inline-index-list.md_client.snap new file mode 100644 index 0000000000..6e9d6172f2 --- /dev/null +++ b/tests/core/snapshots/inline-index-list.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + username: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/inline-index-list.md_merged.snap b/tests/core/snapshots/inline-index-list.md_merged.snap new file mode 100644 index 0000000000..75482b2360 --- /dev/null +++ b/tests/core/snapshots/inline-index-list.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query @addField(name: "username", path: ["username", "0", "name"]) { + username: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") @modify(omit: true) +} + +type User { + name: String +} diff --git a/tests/core/snapshots/inline-many-list.md_client.snap b/tests/core/snapshots/inline-many-list.md_client.snap new file mode 100644 index 0000000000..019b06f8e1 --- /dev/null +++ b/tests/core/snapshots/inline-many-list.md_client.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + u: U +} + +type U { + b: [String] + c: String + d: String + e: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/inline-many-list.md_merged.snap b/tests/core/snapshots/inline-many-list.md_merged.snap new file mode 100644 index 0000000000..948144023f --- /dev/null +++ b/tests/core/snapshots/inline-many-list.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type A { + b: [String] + c: String + d: String +} + +type Query { + u: U @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/us/1") +} + +type U @addField(name: "b", path: ["a", "b"]) @addField(name: "c", path: ["a", "c"]) @addField(name: "d", path: ["a", "d"]) { + a: A @modify(omit: true) + e: String +} diff --git a/tests/core/snapshots/inline-many.md_client.snap b/tests/core/snapshots/inline-many.md_client.snap new file mode 100644 index 0000000000..a063ed8484 --- /dev/null +++ b/tests/core/snapshots/inline-many.md_client.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + city: String + name: String + street: String + zipcode: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/inline-many.md_merged.snap b/tests/core/snapshots/inline-many.md_merged.snap new file mode 100644 index 0000000000..480ebd722d --- /dev/null +++ b/tests/core/snapshots/inline-many.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + city: String + street: String + zipcode: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "city", path: ["address", "city"]) @addField(name: "street", path: ["address", "street"]) @addField(name: "zipcode", path: ["address", "zipcode"]) { + address: Address @modify(omit: true) + name: String +} diff --git a/tests/core/snapshots/io-cache.md_0.snap b/tests/core/snapshots/io-cache.md_0.snap new file mode 100644 index 0000000000..78ec8aca42 --- /dev/null +++ b/tests/core/snapshots/io-cache.md_0.snap @@ -0,0 +1,52 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "title": "a", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "b", + "user": { + "name": "Leanne Graham" + } + }, + { + "title": "c", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "d", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "e", + "user": { + "name": "Ervin Howell" + } + }, + { + "title": "f", + "user": { + "name": "Ervin Howell" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/io-cache.md_client.snap b/tests/core/snapshots/io-cache.md_client.snap new file mode 100644 index 0000000000..322138d3b6 --- /dev/null +++ b/tests/core/snapshots/io-cache.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String! + id: Int! + title: String! + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/io-cache.md_merged.snap b/tests/core/snapshots/io-cache.md_merged.snap new file mode 100644 index 0000000000..7669ff0baa --- /dev/null +++ b/tests/core/snapshots/io-cache.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { + query: Query +} + +type Post { + body: String! + id: Int! + title: String! + user: User @http(path: "/users/{{.value.userId}}") + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap new file mode 100644 index 0000000000..64e4c375c5 --- /dev/null +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_0.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "title": "title1", + "user": { + "name": "Leanne Graham" + } + } + ] + } + } +} diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap new file mode 100644 index 0000000000..d7e7d165cd --- /dev/null +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int! + title: String! + user(id: Int): User + userId: Int! +} + +type Query { + posts: [Post] + user(id: Int!): User + users: [User] +} + +scalar Url + +type User { + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap new file mode 100644 index 0000000000..a5a42cbbac --- /dev/null +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap @@ -0,0 +1,25 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 100, headers: []}, httpCache: true) { + query: Query +} + +type Post { + id: Int! + title: String! + user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts") + user(id: Int!): User @http(path: "/users/{{.args.id}}") + users: [User] @http(path: "/users") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/modified-field.md_0.snap b/tests/core/snapshots/modified-field.md_0.snap new file mode 100644 index 0000000000..f932b05da0 --- /dev/null +++ b/tests/core/snapshots/modified-field.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "fullname": "Leanne Graham" + } + } + } +} diff --git a/tests/core/snapshots/modified-field.md_client.snap b/tests/core/snapshots/modified-field.md_client.snap new file mode 100644 index 0000000000..bd0fb67424 --- /dev/null +++ b/tests/core/snapshots/modified-field.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + fullname: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/modified-field.md_merged.snap b/tests/core/snapshots/modified-field.md_merged.snap new file mode 100644 index 0000000000..8983ed6a45 --- /dev/null +++ b/tests/core/snapshots/modified-field.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + name: String @modify(name: "fullname") +} diff --git a/tests/core/snapshots/mutation-put.md_0.snap b/tests/core/snapshots/mutation-put.md_0.snap new file mode 100644 index 0000000000..df1c1b3a6d --- /dev/null +++ b/tests/core/snapshots/mutation-put.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "insertPost": { + "body": "abc" + } + } + } +} diff --git a/tests/core/snapshots/mutation-put.md_client.snap b/tests/core/snapshots/mutation-put.md_client.snap new file mode 100644 index 0000000000..5e1c62be04 --- /dev/null +++ b/tests/core/snapshots/mutation-put.md_client.snap @@ -0,0 +1,47 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + insertPost(input: PostInput!): Post +} + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int +} + +input PostInput { + body: String + id: Int + title: String + userId: Int +} + +type Query { + firstUser: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/mutation-put.md_merged.snap b/tests/core/snapshots/mutation-put.md_merged.snap new file mode 100644 index 0000000000..065cde9ea8 --- /dev/null +++ b/tests/core/snapshots/mutation-put.md_merged.snap @@ -0,0 +1,35 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query + mutation: Mutation +} + +input PostInput { + body: String + id: Int + title: String + userId: Int +} + +type Mutation { + insertPost(input: PostInput!): Post @http(body: "{{.args.input}}", method: "PUT", path: "/posts/{{.args.input.id}}") +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + firstUser: User @http(path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/mutation.md_0.snap b/tests/core/snapshots/mutation.md_0.snap new file mode 100644 index 0000000000..a0b72d835b --- /dev/null +++ b/tests/core/snapshots/mutation.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "insertPost": { + "body": "post-body" + } + } + } +} diff --git a/tests/core/snapshots/mutation.md_client.snap b/tests/core/snapshots/mutation.md_client.snap new file mode 100644 index 0000000000..9ee31d491b --- /dev/null +++ b/tests/core/snapshots/mutation.md_client.snap @@ -0,0 +1,46 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mutation { + insertPost(input: PostInput): Post +} + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int +} + +input PostInput { + body: String + title: String + userId: Int +} + +type Query { + firstUser: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query + mutation: Mutation +} diff --git a/tests/core/snapshots/mutation.md_merged.snap b/tests/core/snapshots/mutation.md_merged.snap new file mode 100644 index 0000000000..3e58b3f436 --- /dev/null +++ b/tests/core/snapshots/mutation.md_merged.snap @@ -0,0 +1,34 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query + mutation: Mutation +} + +input PostInput { + body: String + title: String + userId: Int +} + +type Mutation { + insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + firstUser: User @http(path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/n-plus-one-list.md_0.snap b/tests/core/snapshots/n-plus-one-list.md_0.snap new file mode 100644 index 0000000000..f25f1dd6ba --- /dev/null +++ b/tests/core/snapshots/n-plus-one-list.md_0.snap @@ -0,0 +1,52 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "bars": [ + { + "foo": [ + { + "id": 1 + } + ], + "fooId": 1, + "id": 1 + }, + { + "foo": [ + { + "id": 1 + } + ], + "fooId": 1, + "id": 2 + }, + { + "foo": [ + { + "id": 2 + } + ], + "fooId": 2, + "id": 3 + }, + { + "foo": [ + { + "id": 2 + } + ], + "fooId": 2, + "id": 4 + } + ] + } + } +} diff --git a/tests/core/snapshots/n-plus-one-list.md_client.snap b/tests/core/snapshots/n-plus-one-list.md_client.snap new file mode 100644 index 0000000000..908564ca06 --- /dev/null +++ b/tests/core/snapshots/n-plus-one-list.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + foo: [Foo] + fooId: Int! + id: Int! +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + bar: Bar + id: Int! + name: String! +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bars: [Bar] + foos: [Foo] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/n-plus-one-list.md_merged.snap b/tests/core/snapshots/n-plus-one-list.md_merged.snap new file mode 100644 index 0000000000..53889d91c3 --- /dev/null +++ b/tests/core/snapshots/n-plus-one-list.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Bar { + foo: [Foo] @http(batchKey: ["id"], path: "/foos", query: [{key: "id", value: "{{.value.fooId}}"}]) + fooId: Int! + id: Int! +} + +type Foo { + bar: Bar @http(batchKey: ["fooId"], path: "/bars", query: [{key: "fooId", value: "{{.value.id}}"}]) + id: Int! + name: String! +} + +type Query { + bars: [Bar] @http(path: "/bars") + foos: [Foo] @http(path: "/foos") +} diff --git a/tests/core/snapshots/n-plus-one.md_0.snap b/tests/core/snapshots/n-plus-one.md_0.snap new file mode 100644 index 0000000000..4293f81a84 --- /dev/null +++ b/tests/core/snapshots/n-plus-one.md_0.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "foos": [ + { + "bar": { + "fooId": "1", + "id": 1 + }, + "id": 1, + "name": "foo1" + }, + { + "bar": { + "fooId": "2", + "id": 2 + }, + "id": 2, + "name": "foo2" + } + ] + } + } +} diff --git a/tests/core/snapshots/n-plus-one.md_client.snap b/tests/core/snapshots/n-plus-one.md_client.snap new file mode 100644 index 0000000000..908564ca06 --- /dev/null +++ b/tests/core/snapshots/n-plus-one.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + foo: [Foo] + fooId: Int! + id: Int! +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + bar: Bar + id: Int! + name: String! +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bars: [Bar] + foos: [Foo] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/n-plus-one.md_merged.snap b/tests/core/snapshots/n-plus-one.md_merged.snap new file mode 100644 index 0000000000..53889d91c3 --- /dev/null +++ b/tests/core/snapshots/n-plus-one.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Bar { + foo: [Foo] @http(batchKey: ["id"], path: "/foos", query: [{key: "id", value: "{{.value.fooId}}"}]) + fooId: Int! + id: Int! +} + +type Foo { + bar: Bar @http(batchKey: ["fooId"], path: "/bars", query: [{key: "fooId", value: "{{.value.id}}"}]) + id: Int! + name: String! +} + +type Query { + bars: [Bar] @http(path: "/bars") + foos: [Foo] @http(path: "/foos") +} diff --git a/tests/core/snapshots/nested-objects.md_0.snap b/tests/core/snapshots/nested-objects.md_0.snap new file mode 100644 index 0000000000..81e0aa2d2f --- /dev/null +++ b/tests/core/snapshots/nested-objects.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "address": { + "geo": { + "lat": "-37.3159" + } + } + } + } + } +} diff --git a/tests/core/snapshots/nested-objects.md_client.snap b/tests/core/snapshots/nested-objects.md_client.snap new file mode 100644 index 0000000000..51c3f1f41b --- /dev/null +++ b/tests/core/snapshots/nested-objects.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Address { + geo: Geo + street: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Geo { + lat: String + lng: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: Address +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/nested-objects.md_merged.snap b/tests/core/snapshots/nested-objects.md_merged.snap new file mode 100644 index 0000000000..f2617d9e54 --- /dev/null +++ b/tests/core/snapshots/nested-objects.md_merged.snap @@ -0,0 +1,25 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + geo: Geo + street: String +} + +type Geo { + lat: String + lng: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + address: Address +} diff --git a/tests/core/snapshots/nesting-level3.md_0.snap b/tests/core/snapshots/nesting-level3.md_0.snap new file mode 100644 index 0000000000..bf53033aef --- /dev/null +++ b/tests/core/snapshots/nesting-level3.md_0.snap @@ -0,0 +1,38 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "post": { + "user": { + "todos": [ + { + "completed": false + }, + { + "completed": false + }, + { + "completed": false + }, + { + "completed": true + }, + { + "completed": false + }, + { + "completed": false + } + ] + } + } + } + } +} diff --git a/tests/core/snapshots/nesting-level3.md_client.snap b/tests/core/snapshots/nesting-level3.md_client.snap new file mode 100644 index 0000000000..d628fab7b1 --- /dev/null +++ b/tests/core/snapshots/nesting-level3.md_client.snap @@ -0,0 +1,45 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + post: Post +} + +type Todo { + completed: Boolean +} + +scalar Url + +type User { + email: String! + id: Int! + name: String! + phone: String + todos: [Todo] + username: String! + website: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/nesting-level3.md_merged.snap b/tests/core/snapshots/nesting-level3.md_merged.snap new file mode 100644 index 0000000000..4dc614c158 --- /dev/null +++ b/tests/core/snapshots/nesting-level3.md_merged.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(path: "/users/{{.value.userId}}") + userId: Int! +} + +type Query { + post: Post @http(path: "/posts/1") +} + +type Todo { + completed: Boolean +} + +type User { + email: String! + id: Int! + name: String! + phone: String + todos: [Todo] @http(path: "/users/{{.value.id}}/todos") + username: String! + website: String +} diff --git a/tests/core/snapshots/nullable-arg-query.md_0.snap b/tests/core/snapshots/nullable-arg-query.md_0.snap new file mode 100644 index 0000000000..416637ca30 --- /dev/null +++ b/tests/core/snapshots/nullable-arg-query.md_0.snap @@ -0,0 +1,46 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users": [ + { + "id": 1 + }, + { + "id": 2 + }, + { + "id": 3 + }, + { + "id": 4 + }, + { + "id": 5 + }, + { + "id": 6 + }, + { + "id": 7 + }, + { + "id": 8 + }, + { + "id": 9 + }, + { + "id": 10 + } + ] + } + } +} diff --git a/tests/core/snapshots/nullable-arg-query.md_1.snap b/tests/core/snapshots/nullable-arg-query.md_1.snap new file mode 100644 index 0000000000..fba365192d --- /dev/null +++ b/tests/core/snapshots/nullable-arg-query.md_1.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "users": [ + { + "id": 1 + } + ] + } + } +} diff --git a/tests/core/snapshots/nullable-arg-query.md_client.snap b/tests/core/snapshots/nullable-arg-query.md_client.snap new file mode 100644 index 0000000000..d0ed27e549 --- /dev/null +++ b/tests/core/snapshots/nullable-arg-query.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + users(id: ID): [User] +} + +scalar Url + +type User { + id: ID! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/nullable-arg-query.md_merged.snap b/tests/core/snapshots/nullable-arg-query.md_merged.snap new file mode 100644 index 0000000000..1ca244272c --- /dev/null +++ b/tests/core/snapshots/nullable-arg-query.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + users(id: ID): [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + id: ID! + name: String! +} diff --git a/tests/core/snapshots/omit-index-list.md_0.snap b/tests/core/snapshots/omit-index-list.md_0.snap new file mode 100644 index 0000000000..a5b7c188b6 --- /dev/null +++ b/tests/core/snapshots/omit-index-list.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "username": "Leanne Graham" + } + } +} diff --git a/tests/core/snapshots/omit-index-list.md_client.snap b/tests/core/snapshots/omit-index-list.md_client.snap new file mode 100644 index 0000000000..6e9d6172f2 --- /dev/null +++ b/tests/core/snapshots/omit-index-list.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + username: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/omit-index-list.md_merged.snap b/tests/core/snapshots/omit-index-list.md_merged.snap new file mode 100644 index 0000000000..75482b2360 --- /dev/null +++ b/tests/core/snapshots/omit-index-list.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query @addField(name: "username", path: ["username", "0", "name"]) { + username: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") @modify(omit: true) +} + +type User { + name: String +} diff --git a/tests/core/snapshots/omit-many.md_client.snap b/tests/core/snapshots/omit-many.md_client.snap new file mode 100644 index 0000000000..6517675baa --- /dev/null +++ b/tests/core/snapshots/omit-many.md_client.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + complements: [String] + name: String + zipcode: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/omit-many.md_merged.snap b/tests/core/snapshots/omit-many.md_merged.snap new file mode 100644 index 0000000000..8a9c853868 --- /dev/null +++ b/tests/core/snapshots/omit-many.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + city: String + complements: [String] + street: String + zipcode: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "zipcode", path: ["address", "zipcode"]) @addField(name: "complements", path: ["address", "complements"]) { + address: Address @omit + name: String +} diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_0.snap b/tests/core/snapshots/omit-resolved-by-parent.md_0.snap new file mode 100644 index 0000000000..33ee8d1664 --- /dev/null +++ b/tests/core/snapshots/omit-resolved-by-parent.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "address": "Kulas Light" + } + } + } +} diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_client.snap b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap new file mode 100644 index 0000000000..db581c1494 --- /dev/null +++ b/tests/core/snapshots/omit-resolved-by-parent.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap b/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap new file mode 100644 index 0000000000..54c1285f98 --- /dev/null +++ b/tests/core/snapshots/omit-resolved-by-parent.md_merged.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + street: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "address", path: ["address", "street"]) { + address: Address @modify(omit: true) +} diff --git a/tests/core/snapshots/recursive-type-json.md_0.snap b/tests/core/snapshots/recursive-type-json.md_0.snap new file mode 100644 index 0000000000..5d3fb5e67d --- /dev/null +++ b/tests/core/snapshots/recursive-type-json.md_0.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "User1", + "id": 1, + "friend": { + "name": "User2", + "id": 2, + "friend": { + "name": "User2", + "id": 2 + } + } + } + } + } +} diff --git a/tests/core/snapshots/recursive-type-json.md_client.snap b/tests/core/snapshots/recursive-type-json.md_client.snap new file mode 100644 index 0000000000..0ba4af7c68 --- /dev/null +++ b/tests/core/snapshots/recursive-type-json.md_client.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + friend: User + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/recursive-type-json.md_merged.snap b/tests/core/snapshots/recursive-type-json.md_merged.snap new file mode 100644 index 0000000000..1920b7efbb --- /dev/null +++ b/tests/core/snapshots/recursive-type-json.md_merged.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com", httpCache: true) { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/1") +} + +type User { + friend: User @http(path: "/friends/1") + id: Int! + name: String! +} diff --git a/tests/core/snapshots/recursive-types.md_0.snap b/tests/core/snapshots/recursive-types.md_0.snap new file mode 100644 index 0000000000..5d3fb5e67d --- /dev/null +++ b/tests/core/snapshots/recursive-types.md_0.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "User1", + "id": 1, + "friend": { + "name": "User2", + "id": 2, + "friend": { + "name": "User2", + "id": 2 + } + } + } + } + } +} diff --git a/tests/core/snapshots/recursive-types.md_client.snap b/tests/core/snapshots/recursive-types.md_client.snap new file mode 100644 index 0000000000..c68cd69419 --- /dev/null +++ b/tests/core/snapshots/recursive-types.md_client.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + friend: User + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/recursive-types.md_merged.snap b/tests/core/snapshots/recursive-types.md_merged.snap new file mode 100644 index 0000000000..87b42e1376 --- /dev/null +++ b/tests/core/snapshots/recursive-types.md_merged.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + user: User @http(path: "/users/1") +} + +type User { + friend: User @http(path: "/friends/1") + id: Int + name: String +} diff --git a/tests/core/snapshots/ref-other-nested.md_0.snap b/tests/core/snapshots/ref-other-nested.md_0.snap new file mode 100644 index 0000000000..98cad028b7 --- /dev/null +++ b/tests/core/snapshots/ref-other-nested.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "user1": { + "user2": { + "name": "Leanne Graham" + } + } + } + } + } +} diff --git a/tests/core/snapshots/ref-other-nested.md_client.snap b/tests/core/snapshots/ref-other-nested.md_client.snap new file mode 100644 index 0000000000..0157e58887 --- /dev/null +++ b/tests/core/snapshots/ref-other-nested.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser: User1 +} + +scalar Url + +type User { + id: Int + name: String +} + +type User1 { + user1: User2 +} + +type User2 { + user2: User +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/ref-other-nested.md_merged.snap b/tests/core/snapshots/ref-other-nested.md_merged.snap new file mode 100644 index 0000000000..173f670347 --- /dev/null +++ b/tests/core/snapshots/ref-other-nested.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + firstUser: User1 @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} + +type User1 { + user1: User2 +} + +type User2 { + user2: User @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") +} diff --git a/tests/core/snapshots/ref-other.md_0.snap b/tests/core/snapshots/ref-other.md_0.snap new file mode 100644 index 0000000000..73bdac00d5 --- /dev/null +++ b/tests/core/snapshots/ref-other.md_0.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "user1": { + "name": "Leanne Graham" + } + } + } + } +} diff --git a/tests/core/snapshots/ref-other.md_client.snap b/tests/core/snapshots/ref-other.md_client.snap new file mode 100644 index 0000000000..1e285d9604 --- /dev/null +++ b/tests/core/snapshots/ref-other.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser: User1 +} + +scalar Url + +type User { + id: Int + name: String +} + +type User1 { + user1: User +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/ref-other.md_merged.snap b/tests/core/snapshots/ref-other.md_merged.snap new file mode 100644 index 0000000000..90053056f7 --- /dev/null +++ b/tests/core/snapshots/ref-other.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + firstUser: User1 +} + +type User { + id: Int + name: String +} + +type User1 { + user1: User @http(path: "/users/1") +} diff --git a/tests/core/snapshots/rename-field.md_0.snap b/tests/core/snapshots/rename-field.md_0.snap new file mode 100644 index 0000000000..2db7000d43 --- /dev/null +++ b/tests/core/snapshots/rename-field.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user1": { + "name": "Leanne Graham" + } + } + } +} diff --git a/tests/core/snapshots/rename-field.md_1.snap b/tests/core/snapshots/rename-field.md_1.snap new file mode 100644 index 0000000000..76cb55bf18 --- /dev/null +++ b/tests/core/snapshots/rename-field.md_1.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user2": { + "name": "Ervin Howell" + } + } + } +} diff --git a/tests/core/snapshots/rename-field.md_client.snap b/tests/core/snapshots/rename-field.md_client.snap new file mode 100644 index 0000000000..dc9cb4bcd1 --- /dev/null +++ b/tests/core/snapshots/rename-field.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user1: User + user2: User +} + +scalar Url + +type User { + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/rename-field.md_merged.snap b/tests/core/snapshots/rename-field.md_merged.snap new file mode 100644 index 0000000000..919ae1a4a1 --- /dev/null +++ b/tests/core/snapshots/rename-field.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + person1: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") @modify(name: "user1") + person2: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/2") @modify(name: "user2") +} + +type User { + name: String +} diff --git a/tests/core/snapshots/request-to-upstream-batching.md_0.snap b/tests/core/snapshots/request-to-upstream-batching.md_0.snap new file mode 100644 index 0000000000..910fe79ff4 --- /dev/null +++ b/tests/core/snapshots/request-to-upstream-batching.md_0.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": [ + { + "data": { + "user": { + "id": 1, + "name": "foo" + } + } + }, + { + "data": { + "user": { + "id": 2, + "name": "bar" + } + } + } + ] +} diff --git a/tests/core/snapshots/request-to-upstream-batching.md_client.snap b/tests/core/snapshots/request-to-upstream-batching.md_client.snap new file mode 100644 index 0000000000..a39792ca85 --- /dev/null +++ b/tests/core/snapshots/request-to-upstream-batching.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/request-to-upstream-batching.md_merged.snap b/tests/core/snapshots/request-to-upstream-batching.md_merged.snap new file mode 100644 index 0000000000..b72e0d430f --- /dev/null +++ b/tests/core/snapshots/request-to-upstream-batching.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { + query: Query +} + +type Query { + user(id: Int!): User @http(baseURL: "http://jsonplaceholder.typicode.com", batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/resolve-with-headers.md_0.snap b/tests/core/snapshots/resolve-with-headers.md_0.snap new file mode 100644 index 0000000000..918dbaba7a --- /dev/null +++ b/tests/core/snapshots/resolve-with-headers.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "post1": { + "title": "post title" + } + } + } +} diff --git a/tests/core/snapshots/resolve-with-headers.md_client.snap b/tests/core/snapshots/resolve-with-headers.md_client.snap new file mode 100644 index 0000000000..b80ed2b615 --- /dev/null +++ b/tests/core/snapshots/resolve-with-headers.md_client.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String! + id: ID! + title: String! + userId: ID! +} + +type Query { + post1: Post +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/resolve-with-headers.md_merged.snap b/tests/core/snapshots/resolve-with-headers.md_merged.snap new file mode 100644 index 0000000000..2ef60df846 --- /dev/null +++ b/tests/core/snapshots/resolve-with-headers.md_merged.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(allowedHeaders: ["authorization"]) { + query: Query +} + +type Post { + body: String! + id: ID! + title: String! + userId: ID! +} + +type Query { + post1: Post @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts/{{.headers.authorization}}") +} diff --git a/tests/core/snapshots/resolve-with-vars.md_0.snap b/tests/core/snapshots/resolve-with-vars.md_0.snap new file mode 100644 index 0000000000..47bfa75fff --- /dev/null +++ b/tests/core/snapshots/resolve-with-vars.md_0.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": [ + { + "name": "Leanne Graham" + } + ] + } + } +} diff --git a/tests/core/snapshots/resolve-with-vars.md_client.snap b/tests/core/snapshots/resolve-with-vars.md_client.snap new file mode 100644 index 0000000000..e7f00943cb --- /dev/null +++ b/tests/core/snapshots/resolve-with-vars.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/resolve-with-vars.md_merged.snap b/tests/core/snapshots/resolve-with-vars.md_merged.snap new file mode 100644 index 0000000000..a3cc637dd8 --- /dev/null +++ b/tests/core/snapshots/resolve-with-vars.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(vars: [{key: "id", value: "1"}]) @upstream { + query: Query +} + +type Query { + user: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.vars.id}}"}]) +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/resolved-by-parent.md_0.snap b/tests/core/snapshots/resolved-by-parent.md_0.snap new file mode 100644 index 0000000000..33ee8d1664 --- /dev/null +++ b/tests/core/snapshots/resolved-by-parent.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "address": "Kulas Light" + } + } + } +} diff --git a/tests/core/snapshots/resolved-by-parent.md_client.snap b/tests/core/snapshots/resolved-by-parent.md_client.snap new file mode 100644 index 0000000000..db581c1494 --- /dev/null +++ b/tests/core/snapshots/resolved-by-parent.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + address: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/resolved-by-parent.md_merged.snap b/tests/core/snapshots/resolved-by-parent.md_merged.snap new file mode 100644 index 0000000000..54c1285f98 --- /dev/null +++ b/tests/core/snapshots/resolved-by-parent.md_merged.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Address { + street: String +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User @addField(name: "address", path: ["address", "street"]) { + address: Address @modify(omit: true) +} diff --git a/tests/core/snapshots/rest-api-error.md_0.snap b/tests/core/snapshots/rest-api-error.md_0.snap new file mode 100644 index 0000000000..71f1df3c32 --- /dev/null +++ b/tests/core/snapshots/rest-api-error.md_0.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 500, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: non-null types require a return value", + "locations": [ + { + "line": 3, + "column": 5 + } + ], + "path": [ + "user", + "id" + ] + } + ] + } +} diff --git a/tests/core/snapshots/rest-api-error.md_client.snap b/tests/core/snapshots/rest-api-error.md_client.snap new file mode 100644 index 0000000000..b6fca1b4e8 --- /dev/null +++ b/tests/core/snapshots/rest-api-error.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/rest-api-error.md_merged.snap b/tests/core/snapshots/rest-api-error.md_merged.snap new file mode 100644 index 0000000000..7ef5777788 --- /dev/null +++ b/tests/core/snapshots/rest-api-error.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/{{.args.id}}") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/rest-api-post.md_0.snap b/tests/core/snapshots/rest-api-post.md_0.snap new file mode 100644 index 0000000000..cc6597baac --- /dev/null +++ b/tests/core/snapshots/rest-api-post.md_0.snap @@ -0,0 +1,14 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "id": 1, + "name": "foo" + } +} diff --git a/tests/core/snapshots/rest-api-post.md_client.snap b/tests/core/snapshots/rest-api-post.md_client.snap new file mode 100644 index 0000000000..b6fca1b4e8 --- /dev/null +++ b/tests/core/snapshots/rest-api-post.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/rest-api-post.md_merged.snap b/tests/core/snapshots/rest-api-post.md_merged.snap new file mode 100644 index 0000000000..7ef5777788 --- /dev/null +++ b/tests/core/snapshots/rest-api-post.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/{{.args.id}}") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/rest-api.md_0.snap b/tests/core/snapshots/rest-api.md_0.snap new file mode 100644 index 0000000000..cc6597baac --- /dev/null +++ b/tests/core/snapshots/rest-api.md_0.snap @@ -0,0 +1,14 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "id": 1, + "name": "foo" + } +} diff --git a/tests/core/snapshots/rest-api.md_client.snap b/tests/core/snapshots/rest-api.md_client.snap new file mode 100644 index 0000000000..b6fca1b4e8 --- /dev/null +++ b/tests/core/snapshots/rest-api.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int! + name: String! +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/rest-api.md_merged.snap b/tests/core/snapshots/rest-api.md_merged.snap new file mode 100644 index 0000000000..7ef5777788 --- /dev/null +++ b/tests/core/snapshots/rest-api.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/{{.args.id}}") +} + +type User { + id: Int! + name: String! +} diff --git a/tests/core/snapshots/showcase.md_0.snap b/tests/core/snapshots/showcase.md_0.snap new file mode 100644 index 0000000000..13a20b3310 --- /dev/null +++ b/tests/core/snapshots/showcase.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/showcase.md_1.snap b/tests/core/snapshots/showcase.md_1.snap new file mode 100644 index 0000000000..6dfc7e9df6 --- /dev/null +++ b/tests/core/snapshots/showcase.md_1.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "No Config URL specified" + } + ] + } +} diff --git a/tests/core/snapshots/showcase.md_2.snap b/tests/core/snapshots/showcase.md_2.snap new file mode 100644 index 0000000000..fe3dc5a3b5 --- /dev/null +++ b/tests/core/snapshots/showcase.md_2.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Invalid Config URL specified" + } + ] + } +} diff --git a/tests/core/snapshots/showcase.md_3.snap b/tests/core/snapshots/showcase.md_3.snap new file mode 100644 index 0000000000..b178f82042 --- /dev/null +++ b/tests/core/snapshots/showcase.md_3.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Failed to read config: Validation Error\n• --> 1:1\n |\n1 | \"dsjfsjdfjdsfjkdskjfjkds\"\n | ^---\n |\n = expected type_system_definition\n" + } + ] + } +} diff --git a/tests/core/snapshots/showcase.md_4.snap b/tests/core/snapshots/showcase.md_4.snap new file mode 100644 index 0000000000..543411ada6 --- /dev/null +++ b/tests/core/snapshots/showcase.md_4.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Unexpected GraphQL Request: invalid type: map, expected a string at line 1 column 9" + } + ] + } +} diff --git a/tests/core/snapshots/showcase.md_client.snap b/tests/core/snapshots/showcase.md_client.snap new file mode 100644 index 0000000000..7d841d7546 --- /dev/null +++ b/tests/core/snapshots/showcase.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + not_user: User +} + +scalar Url + +type User { + not_id: Int + not_name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/showcase.md_merged.snap b/tests/core/snapshots/showcase.md_merged.snap new file mode 100644 index 0000000000..dcc936a453 --- /dev/null +++ b/tests/core/snapshots/showcase.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(showcase: true) @upstream { + query: Query +} + +type Query { + not_user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + not_id: Int + not_name: String +} diff --git a/tests/core/snapshots/simple-graphql.md_0.snap b/tests/core/snapshots/simple-graphql.md_0.snap new file mode 100644 index 0000000000..13a20b3310 --- /dev/null +++ b/tests/core/snapshots/simple-graphql.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/simple-graphql.md_1.snap b/tests/core/snapshots/simple-graphql.md_1.snap new file mode 100644 index 0000000000..543411ada6 --- /dev/null +++ b/tests/core/snapshots/simple-graphql.md_1.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "Unexpected GraphQL Request: invalid type: map, expected a string at line 1 column 9" + } + ] + } +} diff --git a/tests/core/snapshots/simple-graphql.md_client.snap b/tests/core/snapshots/simple-graphql.md_client.snap new file mode 100644 index 0000000000..f8c9c2fa86 --- /dev/null +++ b/tests/core/snapshots/simple-graphql.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/simple-graphql.md_merged.snap b/tests/core/snapshots/simple-graphql.md_merged.snap new file mode 100644 index 0000000000..fb720f6f46 --- /dev/null +++ b/tests/core/snapshots/simple-graphql.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/simple-query.md_0.snap b/tests/core/snapshots/simple-query.md_0.snap new file mode 100644 index 0000000000..d24c105fb6 --- /dev/null +++ b/tests/core/snapshots/simple-query.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/simple-query.md_client.snap b/tests/core/snapshots/simple-query.md_client.snap new file mode 100644 index 0000000000..fd73bea4ae --- /dev/null +++ b/tests/core/snapshots/simple-query.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/simple-query.md_merged.snap b/tests/core/snapshots/simple-query.md_merged.snap new file mode 100644 index 0000000000..4582691ba7 --- /dev/null +++ b/tests/core/snapshots/simple-query.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + firstUser: User @http(path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-add-field-list.md_client.snap b/tests/core/snapshots/test-add-field-list.md_client.snap new file mode 100644 index 0000000000..63732a49c6 --- /dev/null +++ b/tests/core/snapshots/test-add-field-list.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type A { + b: B +} + +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + a: A +} + +scalar JSON + +scalar PhoneNumber + +type Query { + b: B + foo: [Foo] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-add-field-list.md_merged.snap b/tests/core/snapshots/test-add-field-list.md_merged.snap new file mode 100644 index 0000000000..10f3b9ca79 --- /dev/null +++ b/tests/core/snapshots/test-add-field-list.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "b", path: ["foo", "a", "0", "b"]) { + foo: [Foo] @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-add-field.md_client.snap b/tests/core/snapshots/test-add-field.md_client.snap new file mode 100644 index 0000000000..3926ab5706 --- /dev/null +++ b/tests/core/snapshots/test-add-field.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type A { + b: B +} + +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + a: A +} + +scalar JSON + +scalar PhoneNumber + +type Query { + b: B + foo: Foo +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-add-field.md_merged.snap b/tests/core/snapshots/test-add-field.md_merged.snap new file mode 100644 index 0000000000..095fa8a918 --- /dev/null +++ b/tests/core/snapshots/test-add-field.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "b", path: ["foo", "a", "b"]) { + foo: Foo @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap new file mode 100644 index 0000000000..bd1061e7db --- /dev/null +++ b/tests/core/snapshots/test-add-link-to-empty-config.md_client.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +enum Foo { + BAR + BAZ +} + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: Foo + hello: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap b/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap new file mode 100644 index 0000000000..724d3e15ed --- /dev/null +++ b/tests/core/snapshots/test-add-link-to-empty-config.md_merged.snap @@ -0,0 +1,7 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream @link(src: "link-expr.graphql", type: Config) @link(src: "link-enum.graphql", type: Config) { + query: Query +} diff --git a/tests/core/snapshots/test-batching-group-by.md_client.snap b/tests/core/snapshots/test-batching-group-by.md_client.snap new file mode 100644 index 0000000000..7ae47b261d --- /dev/null +++ b/tests/core/snapshots/test-batching-group-by.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-batching-group-by.md_merged.snap b/tests/core/snapshots/test-batching-group-by.md_merged.snap new file mode 100644 index 0000000000..10cc028bb6 --- /dev/null +++ b/tests/core/snapshots/test-batching-group-by.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 4000) @upstream(baseURL: "http://abc.com", batch: {delay: 1, headers: [], maxSize: 1000}) { + query: Query +} + +type Post { + body: String + id: Int + title: String + user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts?id=1&id=11") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-cache.md_client.snap b/tests/core/snapshots/test-cache.md_client.snap new file mode 100644 index 0000000000..f8c9c2fa86 --- /dev/null +++ b/tests/core/snapshots/test-cache.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-cache.md_merged.snap b/tests/core/snapshots/test-cache.md_merged.snap new file mode 100644 index 0000000000..2bf0365875 --- /dev/null +++ b/tests/core/snapshots/test-cache.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + user: User @http(path: "/foo") @cache(maxAge: 300) +} + +type User @cache(maxAge: 900) { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap b/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap new file mode 100644 index 0000000000..2fb2f3849c --- /dev/null +++ b/tests/core/snapshots/test-conflict-allowed-headers.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(allowedHeaders: ["a", "b", "c", "d"]) { + query: Query +} + +type Query { + hello: String @expr(body: "world") +} diff --git a/tests/core/snapshots/test-conflict-vars.md_merged.snap b/tests/core/snapshots/test-conflict-vars.md_merged.snap new file mode 100644 index 0000000000..eda8f9a1d5 --- /dev/null +++ b/tests/core/snapshots/test-conflict-vars.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(vars: [{key: "a", value: "b"}, {key: "c", value: "d"}, {key: "p", value: "q"}]) @upstream { + query: Query +} + +type Query { + hello: String @expr(body: "world") +} diff --git a/tests/core/snapshots/test-custom-scalar.md_client.snap b/tests/core/snapshots/test-custom-scalar.md_client.snap new file mode 100644 index 0000000000..f15f9a6a3d --- /dev/null +++ b/tests/core/snapshots/test-custom-scalar.md_client.snap @@ -0,0 +1,25 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar Json + +scalar PhoneNumber + +type Query { + foo: [Json] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-custom-scalar.md_merged.snap b/tests/core/snapshots/test-custom-scalar.md_merged.snap new file mode 100644 index 0000000000..01e731dc0a --- /dev/null +++ b/tests/core/snapshots/test-custom-scalar.md_merged.snap @@ -0,0 +1,13 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +scalar Json + +type Query { + foo: [Json] @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-custom-types.md_client.snap b/tests/core/snapshots/test-custom-types.md_client.snap new file mode 100644 index 0000000000..a7308e2bf3 --- /dev/null +++ b/tests/core/snapshots/test-custom-types.md_client.snap @@ -0,0 +1,41 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type Mut { + insertPost(input: PostInput): Post +} + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int +} + +input PostInput { + body: String + title: String + userId: Int +} + +type Que { + posts: [Post] +} + +scalar Url + +schema { + query: Que + mutation: Mut +} diff --git a/tests/core/snapshots/test-custom-types.md_merged.snap b/tests/core/snapshots/test-custom-types.md_merged.snap new file mode 100644 index 0000000000..4c4cbc5a39 --- /dev/null +++ b/tests/core/snapshots/test-custom-types.md_merged.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Que + mutation: Mut +} + +input PostInput { + body: String + title: String + userId: Int +} + +type Mut { + insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Que { + posts: [Post] @expr(body: [{id: 1}]) +} diff --git a/tests/core/snapshots/test-description-many.md_client.snap b/tests/core/snapshots/test-description-many.md_client.snap new file mode 100644 index 0000000000..c21889cb2e --- /dev/null +++ b/tests/core/snapshots/test-description-many.md_client.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + """ + This is test2 + """ + baz: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + """ + This is test + """ + foo: Bar +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-description-many.md_merged.snap b/tests/core/snapshots/test-description-many.md_merged.snap new file mode 100644 index 0000000000..a8e2022521 --- /dev/null +++ b/tests/core/snapshots/test-description-many.md_merged.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Bar { + """ + This is test2 + """ + baz: String +} + +type Query { + """ + This is test + """ + foo: Bar @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-enum-default.md_0.snap b/tests/core/snapshots/test-enum-default.md_0.snap new file mode 100644 index 0000000000..d177f0791f --- /dev/null +++ b/tests/core/snapshots/test-enum-default.md_0.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "news": { + "news": [ + { + "id": 1, + "foo": "PUBLISHED" + }, + { + "id": 2, + "foo": "DRAFT" + }, + { + "id": 3, + "foo": "ND" + } + ] + } + } + } +} diff --git a/tests/core/snapshots/test-enum-default.md_client.snap b/tests/core/snapshots/test-enum-default.md_client.snap new file mode 100644 index 0000000000..45aa5dcbe8 --- /dev/null +++ b/tests/core/snapshots/test-enum-default.md_client.snap @@ -0,0 +1,38 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + foo: Status + id: Int +} + +type NewsData { + news: [News]! +} + +scalar PhoneNumber + +type Query { + news: NewsData! +} + +enum Status { + DRAFT + ND + PUBLISHED +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-enum-default.md_merged.snap b/tests/core/snapshots/test-enum-default.md_merged.snap new file mode 100644 index 0000000000..fedfe3b663 --- /dev/null +++ b/tests/core/snapshots/test-enum-default.md_merged.snap @@ -0,0 +1,30 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8080) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "./service.proto", type: Protobuf) { + query: Query +} + +enum Status { + DRAFT + ND + PUBLISHED +} + +type News { + foo: Status + id: Int +} + +type NewsData { + news: [News]! +} + +type NewsInput { + id: Int +} + +type Query { + news: NewsData! @grpc(method: "news.NewsService.GetAllNews") +} diff --git a/tests/core/snapshots/test-enum-merge.md_merged.snap b/tests/core/snapshots/test-enum-merge.md_merged.snap new file mode 100644 index 0000000000..f204828260 --- /dev/null +++ b/tests/core/snapshots/test-enum-merge.md_merged.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +enum Foo { + BAR + BAZ + BOOM +} + +type Query { + foo: Foo @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-enum.md_0.snap b/tests/core/snapshots/test-enum.md_0.snap new file mode 100644 index 0000000000..63a4be352d --- /dev/null +++ b/tests/core/snapshots/test-enum.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "foo": "BAR" + } + } +} diff --git a/tests/core/snapshots/test-enum.md_1.snap b/tests/core/snapshots/test-enum.md_1.snap new file mode 100644 index 0000000000..444b7bb300 --- /dev/null +++ b/tests/core/snapshots/test-enum.md_1.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "foo": "BAZ" + } + } +} diff --git a/tests/core/snapshots/test-enum.md_2.snap b/tests/core/snapshots/test-enum.md_2.snap new file mode 100644 index 0000000000..c19c038cf7 --- /dev/null +++ b/tests/core/snapshots/test-enum.md_2.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid item for enum \"Foo\"", + "locations": [ + { + "line": 1, + "column": 9 + } + ], + "path": [ + "foo" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-enum.md_client.snap b/tests/core/snapshots/test-enum.md_client.snap new file mode 100644 index 0000000000..5f025dcda8 --- /dev/null +++ b/tests/core/snapshots/test-enum.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +enum Foo { + BAR + BAZ +} + +scalar JSON + +scalar PhoneNumber + +type Query { + foo(val: String!): Foo +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-enum.md_merged.snap b/tests/core/snapshots/test-enum.md_merged.snap new file mode 100644 index 0000000000..eca36df1c1 --- /dev/null +++ b/tests/core/snapshots/test-enum.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://localhost:8080") { + query: Query +} + +enum Foo { + BAR + BAZ +} + +type Query { + foo(val: String!): Foo @expr(body: "{{.args.val}}") +} diff --git a/tests/core/snapshots/test-expr-with-mustache.md_0.snap b/tests/core/snapshots/test-expr-with-mustache.md_0.snap new file mode 100644 index 0000000000..0f772f2f1c --- /dev/null +++ b/tests/core/snapshots/test-expr-with-mustache.md_0.snap @@ -0,0 +1,29 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": { + "bc": { + "b": [ + 1, + 2, + 3 + ], + "c": "test", + "d": 1, + "f": { + "e": 1 + }, + "g": true + } + } + } + } +} diff --git a/tests/core/snapshots/test-expr-with-mustache.md_client.snap b/tests/core/snapshots/test-expr-with-mustache.md_client.snap new file mode 100644 index 0000000000..563b3e26f4 --- /dev/null +++ b/tests/core/snapshots/test-expr-with-mustache.md_client.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type A { + a: Int + bc: BC +} + +type BC { + b: [Int] + c: String + d: Int + f: D + g: Boolean +} + +type D { + e: Int +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + a: A +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-expr-with-mustache.md_merged.snap b/tests/core/snapshots/test-expr-with-mustache.md_merged.snap new file mode 100644 index 0000000000..6f192d0dee --- /dev/null +++ b/tests/core/snapshots/test-expr-with-mustache.md_merged.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type A { + a: Int + b: [Int] @modify(omit: true) + bc: BC @expr(body: {b: "{{.value.b}}", c: "{{.value.c}}", d: "{{.value.d.e}}", f: "{{.value.d}}", g: "{{.value.g}}"}) + c: String @modify(omit: true) + d: D @modify(omit: true) + g: Boolean @modify(omit: true) +} + +type BC { + b: [Int] + c: String + d: Int + f: D + g: Boolean +} + +type D { + e: Int +} + +type Query { + a: A @expr(body: {a: 0, b: [1, 2, 3], c: "test", d: {e: 1}, g: true}) +} diff --git a/tests/core/snapshots/test-expr.md_client.snap b/tests/core/snapshots/test-expr.md_client.snap new file mode 100644 index 0000000000..246536f601 --- /dev/null +++ b/tests/core/snapshots/test-expr.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hello: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-expr.md_merged.snap b/tests/core/snapshots/test-expr.md_merged.snap new file mode 100644 index 0000000000..de0ae43f5d --- /dev/null +++ b/tests/core/snapshots/test-expr.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + hello: String @expr(body: "Hello from server") +} diff --git a/tests/core/snapshots/test-graphqlsource.md_client.snap b/tests/core/snapshots/test-graphqlsource.md_client.snap new file mode 100644 index 0000000000..17bdbf61cc --- /dev/null +++ b/tests/core/snapshots/test-graphqlsource.md_client.snap @@ -0,0 +1,34 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int! + user: User + userId: Int! +} + +type Query { + post(id: Int!): Post +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-graphqlsource.md_merged.snap b/tests/core/snapshots/test-graphqlsource.md_merged.snap new file mode 100644 index 0000000000..c4d9375595 --- /dev/null +++ b/tests/core/snapshots/test-graphqlsource.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://localhost:8000/graphql") { + query: Query +} + +type Post { + id: Int! + user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], name: "user") + userId: Int! +} + +type Query { + post(id: Int!): Post @http(baseURL: "http://jsonplacheholder.typicode.com", path: "/posts/{{.args.id}}") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-grpc.md_client.snap b/tests/core/snapshots/test-grpc.md_client.snap new file mode 100644 index 0000000000..72b8b8dccc --- /dev/null +++ b/tests/core/snapshots/test-grpc.md_client.snap @@ -0,0 +1,43 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +scalar PhoneNumber + +type Query { + news: NewsData! + newsById(news: NewsInput!): News! + newsByIdBatch(news: NewsInput!): News! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-grpc.md_merged.snap b/tests/core/snapshots/test-grpc.md_merged.snap new file mode 100644 index 0000000000..425c09a8d3 --- /dev/null +++ b/tests/core/snapshots/test-grpc.md_merged.snap @@ -0,0 +1,31 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: [], maxSize: 1000}) @link(id: "news", src: "news.proto", type: Protobuf) { + query: Query +} + +input NewsInput { + body: String + id: Int + postImage: String + title: String +} + +type News { + body: String + id: Int + postImage: String + title: String +} + +type NewsData { + news: [News]! +} + +type Query { + news: NewsData! @grpc(method: "news.NewsService.GetAllNews") + newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") + newsByIdBatch(news: NewsInput!): News! @grpc(body: "{{.args.news}}", batchKey: ["news", "id"], method: "news.NewsService.GetMultipleNews") +} diff --git a/tests/core/snapshots/test-http-baseurl.md_client.snap b/tests/core/snapshots/test-http-baseurl.md_client.snap new file mode 100644 index 0000000000..9387751799 --- /dev/null +++ b/tests/core/snapshots/test-http-baseurl.md_client.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + bar: String + foo: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-http-baseurl.md_merged.snap b/tests/core/snapshots/test-http-baseurl.md_merged.snap new file mode 100644 index 0000000000..342c76e8a3 --- /dev/null +++ b/tests/core/snapshots/test-http-baseurl.md_merged.snap @@ -0,0 +1,12 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://abc.com") { + query: Query +} + +type Query { + bar: String @http(path: "/bar") + foo: String @http(baseURL: "http://foo.com", path: "/foo") +} diff --git a/tests/core/snapshots/test-http-headers.md_client.snap b/tests/core/snapshots/test-http-headers.md_client.snap new file mode 100644 index 0000000000..374d170a70 --- /dev/null +++ b/tests/core/snapshots/test-http-headers.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-http-headers.md_merged.snap b/tests/core/snapshots/test-http-headers.md_merged.snap new file mode 100644 index 0000000000..b94cdc26fb --- /dev/null +++ b/tests/core/snapshots/test-http-headers.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://localhost:4000") { + query: Query +} + +type Query { + foo: String @http(headers: [{key: "foo", value: "bar"}], path: "/foo") +} diff --git a/tests/core/snapshots/test-http-tmpl.md_client.snap b/tests/core/snapshots/test-http-tmpl.md_client.snap new file mode 100644 index 0000000000..5f5cff8b2f --- /dev/null +++ b/tests/core/snapshots/test-http-tmpl.md_client.snap @@ -0,0 +1,34 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int + user: User + userId: Int! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-http-tmpl.md_merged.snap b/tests/core/snapshots/test-http-tmpl.md_merged.snap new file mode 100644 index 0000000000..0ad2f3d3be --- /dev/null +++ b/tests/core/snapshots/test-http-tmpl.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Post { + id: Int + user: User @http(path: "/users", query: [{key: "id", value: "{{.value.userId}}"}]) + userId: Int! +} + +type Query { + posts: [Post] @http(path: "/posts") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap new file mode 100644 index 0000000000..1f4ae40457 --- /dev/null +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_0.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "a": { + "bc": { + "d": { + "e": 1 + }, + "f": true + } + } + } + } +} diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap new file mode 100644 index 0000000000..3ab88b233b --- /dev/null +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_client.snap @@ -0,0 +1,37 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type A { + a: Int + bc: BC +} + +type BC { + d: D + f: Boolean +} + +type D { + e: Int +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + a: A +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap b/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap new file mode 100644 index 0000000000..c94d63a06f --- /dev/null +++ b/tests/core/snapshots/test-http-with-mustache-expr.md_merged.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type A { + a: Int + bc: BC @expr(body: {d: "{{.value.d}}", f: "{{.value.f}}"}) + d: D @modify(omit: true) +} + +type BC { + d: D + f: Boolean +} + +type D { + e: Int +} + +type Query { + a: A @http(baseURL: "http://localhost:3000", path: "/a") +} diff --git a/tests/core/snapshots/test-http.md_client.snap b/tests/core/snapshots/test-http.md_client.snap new file mode 100644 index 0000000000..1d4b0f34bb --- /dev/null +++ b/tests/core/snapshots/test-http.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-http.md_merged.snap b/tests/core/snapshots/test-http.md_merged.snap new file mode 100644 index 0000000000..3cc961ecb4 --- /dev/null +++ b/tests/core/snapshots/test-http.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + foo: [User] @http(path: "/users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-inline-list.md_client.snap b/tests/core/snapshots/test-inline-list.md_client.snap new file mode 100644 index 0000000000..9308d7eedc --- /dev/null +++ b/tests/core/snapshots/test-inline-list.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-inline-list.md_merged.snap b/tests/core/snapshots/test-inline-list.md_merged.snap new file mode 100644 index 0000000000..ec95563c26 --- /dev/null +++ b/tests/core/snapshots/test-inline-list.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "foo", path: ["foo", "a", "0", "b"]) { + foo: [Foo] @http(path: "/foo") @modify(omit: true) +} diff --git a/tests/core/snapshots/test-inline.md_client.snap b/tests/core/snapshots/test-inline.md_client.snap new file mode 100644 index 0000000000..9308d7eedc --- /dev/null +++ b/tests/core/snapshots/test-inline.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-inline.md_merged.snap b/tests/core/snapshots/test-inline.md_merged.snap new file mode 100644 index 0000000000..cdb38002a2 --- /dev/null +++ b/tests/core/snapshots/test-inline.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "foo", path: ["foo", "a", "b"]) { + foo: Foo @http(path: "/foo") @modify(omit: true) +} diff --git a/tests/core/snapshots/test-interface-result.md_client.snap b/tests/core/snapshots/test-interface-result.md_client.snap new file mode 100644 index 0000000000..f374cc4b72 --- /dev/null +++ b/tests/core/snapshots/test-interface-result.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B implements IA { + a: String + b: String +} + +scalar Date + +scalar Email + +scalar Empty + +interface IA { + a: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bar: IA +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-interface-result.md_merged.snap b/tests/core/snapshots/test-interface-result.md_merged.snap new file mode 100644 index 0000000000..f8322407d6 --- /dev/null +++ b/tests/core/snapshots/test-interface-result.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +interface IA { + a: String +} + +type B implements IA { + a: String + b: String +} + +type Query { + bar: IA @http(path: "/user") +} diff --git a/tests/core/snapshots/test-interface.md_client.snap b/tests/core/snapshots/test-interface.md_client.snap new file mode 100644 index 0000000000..c62d23aa48 --- /dev/null +++ b/tests/core/snapshots/test-interface.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B implements IA { + a: String + b: String +} + +scalar Date + +scalar Email + +scalar Empty + +interface IA { + a: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bar: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-interface.md_merged.snap b/tests/core/snapshots/test-interface.md_merged.snap new file mode 100644 index 0000000000..a01ce94e07 --- /dev/null +++ b/tests/core/snapshots/test-interface.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +interface IA { + a: String +} + +type B implements IA { + a: String + b: String +} + +type Query { + bar: B @http(path: "/user") +} diff --git a/tests/core/snapshots/test-js-request-reponse.md_0.snap b/tests/core/snapshots/test-js-request-reponse.md_0.snap new file mode 100644 index 0000000000..feebdc4cda --- /dev/null +++ b/tests/core/snapshots/test-js-request-reponse.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "hi": "hello world" + } + } +} diff --git a/tests/core/snapshots/test-js-request-reponse.md_client.snap b/tests/core/snapshots/test-js-request-reponse.md_client.snap new file mode 100644 index 0000000000..234db86478 --- /dev/null +++ b/tests/core/snapshots/test-js-request-reponse.md_client.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hello: String + hi: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-js-request-reponse.md_merged.snap b/tests/core/snapshots/test-js-request-reponse.md_merged.snap new file mode 100644 index 0000000000..74acf0b4ff --- /dev/null +++ b/tests/core/snapshots/test-js-request-reponse.md_merged.snap @@ -0,0 +1,12 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream @link(src: "test.js", type: Script) { + query: Query +} + +type Query { + hello: String @http(baseURL: "http://localhost:3000", path: "/hello") + hi: String @http(baseURL: "http://localhost:3000", path: "/hi") +} diff --git a/tests/core/snapshots/test-merge-batch.md_merged.snap b/tests/core/snapshots/test-merge-batch.md_merged.snap new file mode 100644 index 0000000000..c5fc6e4c4a --- /dev/null +++ b/tests/core/snapshots/test-merge-batch.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(batch: {delay: 5, headers: ["a", "b", "c"], maxSize: 100}) { + query: Query +} + +type Query { + hello: String @expr(body: "world") +} diff --git a/tests/core/snapshots/test-merge-nested.md_merged.snap b/tests/core/snapshots/test-merge-nested.md_merged.snap new file mode 100644 index 0000000000..55c1e360a9 --- /dev/null +++ b/tests/core/snapshots/test-merge-nested.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://abc.com") { + query: Query +} + +type Foo { + """ + test2 + """ + a: String + """ + test1 + """ + b: String +} + +type Query { + hi: Foo @expr(body: {a: "world"}) +} diff --git a/tests/core/snapshots/test-merge-query.md_merged.snap b/tests/core/snapshots/test-merge-query.md_merged.snap new file mode 100644 index 0000000000..56a1e62198 --- /dev/null +++ b/tests/core/snapshots/test-merge-query.md_merged.snap @@ -0,0 +1,12 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000) @upstream(baseURL: "http://abc.com", proxy: {url: "http://localhost:3000"}) { + query: Query +} + +type Query { + hello: String @expr(body: "world") + hi: String @expr(body: "world") +} diff --git a/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap new file mode 100644 index 0000000000..40d931b741 --- /dev/null +++ b/tests/core/snapshots/test-merge-right-with-link-config.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +type Foo { + bar: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: Foo +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap b/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap new file mode 100644 index 0000000000..752503e827 --- /dev/null +++ b/tests/core/snapshots/test-merge-right-with-link-config.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(allowedHeaders: ["Authorization"]) @link(src: "stripe-types.graphql", type: Config) { + query: Query +} + +type Query { + foo: Foo @expr(body: {bar: "foo"}) +} diff --git a/tests/core/snapshots/test-merge-server-sdl.md_client.snap b/tests/core/snapshots/test-merge-server-sdl.md_client.snap new file mode 100644 index 0000000000..1d4b0f34bb --- /dev/null +++ b/tests/core/snapshots/test-merge-server-sdl.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: [User] +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-merge-server-sdl.md_merged.snap b/tests/core/snapshots/test-merge-server-sdl.md_merged.snap new file mode 100644 index 0000000000..3cc961ecb4 --- /dev/null +++ b/tests/core/snapshots/test-merge-server-sdl.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + foo: [User] @http(path: "/users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-merge-union.md_merged.snap b/tests/core/snapshots/test-merge-union.md_merged.snap new file mode 100644 index 0000000000..05a24d2691 --- /dev/null +++ b/tests/core/snapshots/test-merge-union.md_merged.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +union FooBar = Bar | Baz | Foo + +type Bar { + bar: String +} + +type Baz { + baz: String +} + +type Foo { + a: String + foo: String +} + +type Query { + foo: FooBar @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-modify.md_client.snap b/tests/core/snapshots/test-modify.md_client.snap new file mode 100644 index 0000000000..8d46ada4a5 --- /dev/null +++ b/tests/core/snapshots/test-modify.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +input Foo { + bar: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + data(input: Foo): String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-modify.md_merged.snap b/tests/core/snapshots/test-modify.md_merged.snap new file mode 100644 index 0000000000..88436fcb55 --- /dev/null +++ b/tests/core/snapshots/test-modify.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +input Foo { + bar: String +} + +type Query { + foo(input: Foo): String @http(path: "/foo") @modify(name: "data") +} diff --git a/tests/core/snapshots/test-multi-interface.md_client.snap b/tests/core/snapshots/test-multi-interface.md_client.snap new file mode 100644 index 0000000000..b3e62e99f4 --- /dev/null +++ b/tests/core/snapshots/test-multi-interface.md_client.snap @@ -0,0 +1,36 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B implements IA & IB { + a: String + b: String +} + +scalar Date + +scalar Email + +scalar Empty + +interface IA { + a: String +} + +interface IB { + b: String +} + +scalar JSON + +scalar PhoneNumber + +type Query { + bar: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-multi-interface.md_merged.snap b/tests/core/snapshots/test-multi-interface.md_merged.snap new file mode 100644 index 0000000000..f7edbcebf6 --- /dev/null +++ b/tests/core/snapshots/test-multi-interface.md_merged.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +interface IA { + a: String +} + +interface IB { + b: String +} + +type B implements IA & IB { + a: String + b: String +} + +type Query { + bar: B @http(path: "/user") +} diff --git a/tests/core/snapshots/test-nested-input.md_client.snap b/tests/core/snapshots/test-nested-input.md_client.snap new file mode 100644 index 0000000000..5ea104885a --- /dev/null +++ b/tests/core/snapshots/test-nested-input.md_client.snap @@ -0,0 +1,43 @@ +--- +source: tests/core/spec.rs +expression: client +--- +input A { + b: B +} + +input B { + c: C +} + +input C { + d: D +} + +input D { + e: Int +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + a(a: A!): X +} + +scalar Url + +type X { + a: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-nested-input.md_merged.snap b/tests/core/snapshots/test-nested-input.md_merged.snap new file mode 100644 index 0000000000..13f30f666d --- /dev/null +++ b/tests/core/snapshots/test-nested-input.md_merged.snap @@ -0,0 +1,31 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +input A { + b: B +} + +input B { + c: C +} + +input C { + d: D +} + +input D { + e: Int +} + +type Query { + a(a: A!): X @expr(body: {a: "hello"}) +} + +type X { + a: String +} diff --git a/tests/core/snapshots/test-nested-link.md_client.snap b/tests/core/snapshots/test-nested-link.md_client.snap new file mode 100644 index 0000000000..7d41dd312a --- /dev/null +++ b/tests/core/snapshots/test-nested-link.md_client.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +enum Foo { + BAR + BAZ +} + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int! + user: User + userId: Int! +} + +type Query { + foo: Foo + post(id: Int!): Post +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-nested-link.md_merged.snap b/tests/core/snapshots/test-nested-link.md_merged.snap new file mode 100644 index 0000000000..7c13bd430b --- /dev/null +++ b/tests/core/snapshots/test-nested-link.md_merged.snap @@ -0,0 +1,7 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream @link(src: "graphql-with-link.graphql", type: Config) { + query: Query +} diff --git a/tests/core/snapshots/test-nested-value.md_client.snap b/tests/core/snapshots/test-nested-value.md_client.snap new file mode 100644 index 0000000000..fc6739e632 --- /dev/null +++ b/tests/core/snapshots/test-nested-value.md_client.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int + user: User! +} + +type Query { + posts: [Post] +} + +scalar Url + +type User { + id: Int! + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-nested-value.md_merged.snap b/tests/core/snapshots/test-nested-value.md_merged.snap new file mode 100644 index 0000000000..954ba8405b --- /dev/null +++ b/tests/core/snapshots/test-nested-value.md_merged.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Post { + id: Int + user: User! @http(path: "/users", query: [{key: "id", value: "{{.value.user.id}}"}]) +} + +type Query { + posts: [Post] @http(path: "/posts") +} + +type User { + id: Int! + name: String +} diff --git a/tests/core/snapshots/test-null-in-array.md_0.snap b/tests/core/snapshots/test-null-in-array.md_0.snap new file mode 100644 index 0000000000..4d68912c6b --- /dev/null +++ b/tests/core/snapshots/test-null-in-array.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "hi": null + } + } +} diff --git a/tests/core/snapshots/test-null-in-array.md_client.snap b/tests/core/snapshots/test-null-in-array.md_client.snap new file mode 100644 index 0000000000..b452d72d74 --- /dev/null +++ b/tests/core/snapshots/test-null-in-array.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Company { + id: ID + name: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hi(id: ID!): [Company] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-null-in-array.md_merged.snap b/tests/core/snapshots/test-null-in-array.md_merged.snap new file mode 100644 index 0000000000..d11138e7df --- /dev/null +++ b/tests/core/snapshots/test-null-in-array.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Company { + id: ID + name: String +} + +type Query { + hi(id: ID!): [Company] @http(baseURL: "http://localhost:3000", path: "/hi") +} diff --git a/tests/core/snapshots/test-null-in-object.md_0.snap b/tests/core/snapshots/test-null-in-object.md_0.snap new file mode 100644 index 0000000000..4d68912c6b --- /dev/null +++ b/tests/core/snapshots/test-null-in-object.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "hi": null + } + } +} diff --git a/tests/core/snapshots/test-null-in-object.md_client.snap b/tests/core/snapshots/test-null-in-object.md_client.snap new file mode 100644 index 0000000000..b2bd05a708 --- /dev/null +++ b/tests/core/snapshots/test-null-in-object.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Company { + id: ID + name: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hi(id: ID!): Company +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-null-in-object.md_merged.snap b/tests/core/snapshots/test-null-in-object.md_merged.snap new file mode 100644 index 0000000000..e5a749bb3e --- /dev/null +++ b/tests/core/snapshots/test-null-in-object.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Company { + id: ID + name: String +} + +type Query { + hi(id: ID!): Company @http(baseURL: "http://localhost:3000", path: "/hi") +} diff --git a/tests/core/snapshots/test-omit-list.md_client.snap b/tests/core/snapshots/test-omit-list.md_client.snap new file mode 100644 index 0000000000..9308d7eedc --- /dev/null +++ b/tests/core/snapshots/test-omit-list.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-omit-list.md_merged.snap b/tests/core/snapshots/test-omit-list.md_merged.snap new file mode 100644 index 0000000000..672f7a5282 --- /dev/null +++ b/tests/core/snapshots/test-omit-list.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "foo", path: ["foo", "a", "0", "b"]) { + foo: [Foo] @http(path: "/foo") @omit +} diff --git a/tests/core/snapshots/test-omit.md_client.snap b/tests/core/snapshots/test-omit.md_client.snap new file mode 100644 index 0000000000..9308d7eedc --- /dev/null +++ b/tests/core/snapshots/test-omit.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type B { + c: String +} + +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: B +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-omit.md_merged.snap b/tests/core/snapshots/test-omit.md_merged.snap new file mode 100644 index 0000000000..bb6a6a4f07 --- /dev/null +++ b/tests/core/snapshots/test-omit.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type A { + b: B +} + +type B { + c: String +} + +type Foo { + a: A +} + +type Query @addField(name: "foo", path: ["foo", "a", "b"]) { + foo: Foo @http(path: "/foo") @omit +} diff --git a/tests/core/snapshots/test-params-as-body.md_0.snap b/tests/core/snapshots/test-params-as-body.md_0.snap new file mode 100644 index 0000000000..79e85dfc9a --- /dev/null +++ b/tests/core/snapshots/test-params-as-body.md_0.snap @@ -0,0 +1,18 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "id": 1, + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/test-params-as-body.md_client.snap b/tests/core/snapshots/test-params-as-body.md_client.snap new file mode 100644 index 0000000000..926203748b --- /dev/null +++ b/tests/core/snapshots/test-params-as-body.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser(id: Int, name: String): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-params-as-body.md_merged.snap b/tests/core/snapshots/test-params-as-body.md_merged.snap new file mode 100644 index 0000000000..8d9f37e2a6 --- /dev/null +++ b/tests/core/snapshots/test-params-as-body.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + firstUser(id: Int, name: String): User @http(body: "{{.args}}", method: "POST", path: "/users") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-query-documentation.md_client.snap b/tests/core/snapshots/test-query-documentation.md_client.snap new file mode 100644 index 0000000000..bfbe74a5fb --- /dev/null +++ b/tests/core/snapshots/test-query-documentation.md_client.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + """ + This is test + """ + foo: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-query-documentation.md_merged.snap b/tests/core/snapshots/test-query-documentation.md_merged.snap new file mode 100644 index 0000000000..10a23ea587 --- /dev/null +++ b/tests/core/snapshots/test-query-documentation.md_merged.snap @@ -0,0 +1,14 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + """ + This is test + """ + foo: String @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-query.md_client.snap b/tests/core/snapshots/test-query.md_client.snap new file mode 100644 index 0000000000..374d170a70 --- /dev/null +++ b/tests/core/snapshots/test-query.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-query.md_merged.snap b/tests/core/snapshots/test-query.md_merged.snap new file mode 100644 index 0000000000..a1301a03b5 --- /dev/null +++ b/tests/core/snapshots/test-query.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + foo: String @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-ref-other.md_client.snap b/tests/core/snapshots/test-ref-other.md_client.snap new file mode 100644 index 0000000000..78c6f4d5f1 --- /dev/null +++ b/tests/core/snapshots/test-ref-other.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +type InPost { + get: [Post] +} + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int! + userId: Int! +} + +type Query { + posts: InPost +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-ref-other.md_merged.snap b/tests/core/snapshots/test-ref-other.md_merged.snap new file mode 100644 index 0000000000..d70cae6042 --- /dev/null +++ b/tests/core/snapshots/test-ref-other.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type InPost { + get: [Post] @http(path: "/posts") +} + +type Post { + id: Int! + userId: Int! +} + +type Query { + posts: InPost +} diff --git a/tests/core/snapshots/test-response-header-merge.md_merged.snap b/tests/core/snapshots/test-response-header-merge.md_merged.snap new file mode 100644 index 0000000000..d8808602d5 --- /dev/null +++ b/tests/core/snapshots/test-response-header-merge.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {custom: [{key: "a", value: "a"}, {key: "a", value: "b"}]}) @upstream { + query: Query +} + +type Query { + user: User @expr(body: {name: "John"}) +} + +type User { + age: Int + name: String +} diff --git a/tests/core/snapshots/test-scalars.md_0.snap b/tests/core/snapshots/test-scalars.md_0.snap new file mode 100644 index 0000000000..f9589339d0 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_0.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "email": "alo@valid.com" + } + } +} diff --git a/tests/core/snapshots/test-scalars.md_1.snap b/tests/core/snapshots/test-scalars.md_1.snap new file mode 100644 index 0000000000..500fc09ad1 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_1.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "phone": "+1 (614) 1234567" + } + } +} diff --git a/tests/core/snapshots/test-scalars.md_2.snap b/tests/core/snapshots/test-scalars.md_2.snap new file mode 100644 index 0000000000..4f94abe2af --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_2.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "date": "2023-03-08T12:45:26-05:00" + } + } +} diff --git a/tests/core/snapshots/test-scalars.md_3.snap b/tests/core/snapshots/test-scalars.md_3.snap new file mode 100644 index 0000000000..e40c6e03cc --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_3.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "url": "https://tailcall.run/" + } + } +} diff --git a/tests/core/snapshots/test-scalars.md_4.snap b/tests/core/snapshots/test-scalars.md_4.snap new file mode 100644 index 0000000000..f05fab41e1 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_4.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Email\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "email" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_5.snap b/tests/core/snapshots/test-scalars.md_5.snap new file mode 100644 index 0000000000..8b0ea58a37 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_5.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "phone" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_6.snap b/tests/core/snapshots/test-scalars.md_6.snap new file mode 100644 index 0000000000..8b0ea58a37 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_6.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "phone" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_7.snap b/tests/core/snapshots/test-scalars.md_7.snap new file mode 100644 index 0000000000..31a1a3502f --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_7.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Date\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "date" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_8.snap b/tests/core/snapshots/test-scalars.md_8.snap new file mode 100644 index 0000000000..4ab684e59e --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_8.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "internal: invalid value for scalar \"Url\", expected \"FieldValue::Value\"", + "locations": [ + { + "line": 1, + "column": 3 + } + ], + "path": [ + "url" + ] + } + ] + } +} diff --git a/tests/core/snapshots/test-scalars.md_client.snap b/tests/core/snapshots/test-scalars.md_client.snap new file mode 100644 index 0000000000..12653f5f33 --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_client.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + date(value: Date!): Date! + email(value: Email!): Email! + phone(value: PhoneNumber!): PhoneNumber! + url(value: Url!): Url! +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-scalars.md_merged.snap b/tests/core/snapshots/test-scalars.md_merged.snap new file mode 100644 index 0000000000..69c62c196e --- /dev/null +++ b/tests/core/snapshots/test-scalars.md_merged.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(graphiql: true, hostname: "localhost", port: 8000) @upstream { + query: Query +} + +scalar Date + +scalar Email + +scalar PhoneNumber + +scalar Url + +type Query { + date(value: Date!): Date! @expr(body: "{{.args.value}}") + email(value: Email!): Email! @expr(body: "{{.args.value}}") + phone(value: PhoneNumber!): PhoneNumber! @expr(body: "{{.args.value}}") + url(value: Url!): Url! @expr(body: "{{.args.value}}") +} diff --git a/tests/core/snapshots/test-server-base-types.md_merged.snap b/tests/core/snapshots/test-server-base-types.md_merged.snap new file mode 100644 index 0000000000..7174daba96 --- /dev/null +++ b/tests/core/snapshots/test-server-base-types.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(port: 8000) @upstream(baseURL: "http://abc.com", proxy: {url: "http://localhost:3000"}) { + query: Query +} + +type Query { + hello: String @expr(body: "world") +} diff --git a/tests/core/snapshots/test-server-vars.md_client.snap b/tests/core/snapshots/test-server-vars.md_client.snap new file mode 100644 index 0000000000..374d170a70 --- /dev/null +++ b/tests/core/snapshots/test-server-vars.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-server-vars.md_merged.snap b/tests/core/snapshots/test-server-vars.md_merged.snap new file mode 100644 index 0000000000..4f83424678 --- /dev/null +++ b/tests/core/snapshots/test-server-vars.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(vars: [{key: "foo", value: "bar"}]) @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type Query { + foo: String @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-set-cookie-headers.md_0.snap b/tests/core/snapshots/test-set-cookie-headers.md_0.snap new file mode 100644 index 0000000000..3353c44cf4 --- /dev/null +++ b/tests/core/snapshots/test-set-cookie-headers.md_0.snap @@ -0,0 +1,21 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json", + "set-cookie": "user=1; user=2" + }, + "body": { + "data": { + "u1": { + "name": "foo" + }, + "u2": { + "name": "bar" + } + } + } +} diff --git a/tests/core/snapshots/test-set-cookie-headers.md_client.snap b/tests/core/snapshots/test-set-cookie-headers.md_client.snap new file mode 100644 index 0000000000..cb11214253 --- /dev/null +++ b/tests/core/snapshots/test-set-cookie-headers.md_client.snap @@ -0,0 +1,32 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-set-cookie-headers.md_merged.snap b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap new file mode 100644 index 0000000000..8660783954 --- /dev/null +++ b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server(headers: {setCookies: true}, graphiql: true, hostname: "0.0.0.0", port: 8080) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + user(id: Int!): User @http(path: "/users/{{.args.id}}") +} + +type User { + email: String! + id: Int! + name: String! + phone: String + username: String! + website: String +} diff --git a/tests/core/snapshots/test-static-value.md_0.snap b/tests/core/snapshots/test-static-value.md_0.snap new file mode 100644 index 0000000000..a085a7c561 --- /dev/null +++ b/tests/core/snapshots/test-static-value.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "firstUser": { + "name": "Leanne Graham" + } + } + } +} diff --git a/tests/core/snapshots/test-static-value.md_client.snap b/tests/core/snapshots/test-static-value.md_client.snap new file mode 100644 index 0000000000..fd73bea4ae --- /dev/null +++ b/tests/core/snapshots/test-static-value.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + firstUser: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-static-value.md_merged.snap b/tests/core/snapshots/test-static-value.md_merged.snap new file mode 100644 index 0000000000..d4fb7c0f4c --- /dev/null +++ b/tests/core/snapshots/test-static-value.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + firstUser: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/test-tag.md_client.snap b/tests/core/snapshots/test-tag.md_client.snap new file mode 100644 index 0000000000..c38b4b5100 --- /dev/null +++ b/tests/core/snapshots/test-tag.md_client.snap @@ -0,0 +1,38 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +type NEWS { + getAllNews: News__NewsList! +} + +type News__News { + body: String + id: Int + postImage: String + title: String +} + +type News__NewsList { + news: [News__News] +} + +scalar PhoneNumber + +type Query { + news: NEWS +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-tag.md_merged.snap b/tests/core/snapshots/test-tag.md_merged.snap new file mode 100644 index 0000000000..f08a7d791d --- /dev/null +++ b/tests/core/snapshots/test-tag.md_merged.snap @@ -0,0 +1,26 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +type NEWS { + getAllNews: News__NewsList! +} + +type News__News @tag(id: "news.News") { + body: String @expr(body: "This is a news body") + id: Int @expr(body: 1) + postImage: String @expr(body: "http://example.com/image.jpg") + title: String @expr(body: "This is a news title") +} + +type News__NewsList @tag(id: "news.NewsList") { + news: [News__News] +} + +type Query { + news: NEWS +} diff --git a/tests/core/snapshots/test-union.md_client.snap b/tests/core/snapshots/test-union.md_client.snap new file mode 100644 index 0000000000..fa316b3e59 --- /dev/null +++ b/tests/core/snapshots/test-union.md_client.snap @@ -0,0 +1,33 @@ +--- +source: tests/core/spec.rs +expression: client +--- +type Bar { + bar: String +} + +scalar Date + +scalar Email + +scalar Empty + +type Foo { + foo: String +} + +union FooBar = Bar | Foo + +scalar JSON + +scalar PhoneNumber + +type Query { + foo: FooBar +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-union.md_merged.snap b/tests/core/snapshots/test-union.md_merged.snap new file mode 100644 index 0000000000..ac9b0682f9 --- /dev/null +++ b/tests/core/snapshots/test-union.md_merged.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { + query: Query +} + +scalar Baz + +union FooBar = Bar | Foo + +type Bar { + bar: String +} + +type Foo { + foo: String +} + +type Query { + foo: FooBar @http(path: "/foo") +} diff --git a/tests/core/snapshots/test-upstream-headers.md_0.snap b/tests/core/snapshots/test-upstream-headers.md_0.snap new file mode 100644 index 0000000000..db824d6b4b --- /dev/null +++ b/tests/core/snapshots/test-upstream-headers.md_0.snap @@ -0,0 +1,22 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "posts": [ + { + "id": 11 + }, + { + "id": 3 + } + ] + } + } +} diff --git a/tests/core/snapshots/test-upstream-headers.md_client.snap b/tests/core/snapshots/test-upstream-headers.md_client.snap new file mode 100644 index 0000000000..5ba4bd7bd2 --- /dev/null +++ b/tests/core/snapshots/test-upstream-headers.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + id: Int +} + +type Query { + posts: [Post] +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-upstream-headers.md_merged.snap b/tests/core/snapshots/test-upstream-headers.md_merged.snap new file mode 100644 index 0000000000..eca1e38232 --- /dev/null +++ b/tests/core/snapshots/test-upstream-headers.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(allowedHeaders: ["X-bar", "x-foo"], baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Post { + id: Int +} + +type Query { + posts: [Post] @http(path: "/posts") +} diff --git a/tests/core/snapshots/test-upstream.md_client.snap b/tests/core/snapshots/test-upstream.md_client.snap new file mode 100644 index 0000000000..246536f601 --- /dev/null +++ b/tests/core/snapshots/test-upstream.md_client.snap @@ -0,0 +1,23 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + hello: String +} + +scalar Url + +schema { + query: Query +} diff --git a/tests/core/snapshots/test-upstream.md_merged.snap b/tests/core/snapshots/test-upstream.md_merged.snap new file mode 100644 index 0000000000..1bf8df4afc --- /dev/null +++ b/tests/core/snapshots/test-upstream.md_merged.snap @@ -0,0 +1,11 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(proxy: {url: "http://localhost:8085"}) { + query: Query +} + +type Query { + hello: String @http(baseURL: "http://localhost:8000", path: "/hello") +} diff --git a/tests/core/snapshots/upstream-batching.md_0.snap b/tests/core/snapshots/upstream-batching.md_0.snap new file mode 100644 index 0000000000..e8bca1fdcc --- /dev/null +++ b/tests/core/snapshots/upstream-batching.md_0.snap @@ -0,0 +1,20 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "u1": { + "id": 1 + }, + "u2": { + "id": 2 + } + } + } +} diff --git a/tests/core/snapshots/upstream-batching.md_client.snap b/tests/core/snapshots/upstream-batching.md_client.snap new file mode 100644 index 0000000000..7c0bdf72e9 --- /dev/null +++ b/tests/core/snapshots/upstream-batching.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/upstream-batching.md_merged.snap b/tests/core/snapshots/upstream-batching.md_merged.snap new file mode 100644 index 0000000000..96bc34ca2a --- /dev/null +++ b/tests/core/snapshots/upstream-batching.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { + query: Query +} + +type Query { + user(id: Int): User @http(baseURL: "http://jsonplaceholder.typicode.com", batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/upstream-fail-request.md_0.snap b/tests/core/snapshots/upstream-fail-request.md_0.snap new file mode 100644 index 0000000000..95fd0e3582 --- /dev/null +++ b/tests/core/snapshots/upstream-fail-request.md_0.snap @@ -0,0 +1,24 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": null, + "errors": [ + { + "message": "IOException: Status code error", + "locations": [ + { + "line": 1, + "column": 9 + } + ] + } + ] + } +} diff --git a/tests/core/snapshots/upstream-fail-request.md_client.snap b/tests/core/snapshots/upstream-fail-request.md_client.snap new file mode 100644 index 0000000000..f8c9c2fa86 --- /dev/null +++ b/tests/core/snapshots/upstream-fail-request.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user: User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/upstream-fail-request.md_merged.snap b/tests/core/snapshots/upstream-fail-request.md_merged.snap new file mode 100644 index 0000000000..fb720f6f46 --- /dev/null +++ b/tests/core/snapshots/upstream-fail-request.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/with-args-url.md_0.snap b/tests/core/snapshots/with-args-url.md_0.snap new file mode 100644 index 0000000000..13a20b3310 --- /dev/null +++ b/tests/core/snapshots/with-args-url.md_0.snap @@ -0,0 +1,17 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "name": "foo" + } + } + } +} diff --git a/tests/core/snapshots/with-args-url.md_client.snap b/tests/core/snapshots/with-args-url.md_client.snap new file mode 100644 index 0000000000..a39792ca85 --- /dev/null +++ b/tests/core/snapshots/with-args-url.md_client.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): User +} + +scalar Url + +type User { + id: Int + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/with-args-url.md_merged.snap b/tests/core/snapshots/with-args-url.md_merged.snap new file mode 100644 index 0000000000..90a785cd57 --- /dev/null +++ b/tests/core/snapshots/with-args-url.md_merged.snap @@ -0,0 +1,16 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Query { + user(id: Int!): User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/{{.args.id}}") +} + +type User { + id: Int + name: String +} diff --git a/tests/core/snapshots/with-args.md_0.snap b/tests/core/snapshots/with-args.md_0.snap new file mode 100644 index 0000000000..47bfa75fff --- /dev/null +++ b/tests/core/snapshots/with-args.md_0.snap @@ -0,0 +1,19 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": [ + { + "name": "Leanne Graham" + } + ] + } + } +} diff --git a/tests/core/snapshots/with-args.md_client.snap b/tests/core/snapshots/with-args.md_client.snap new file mode 100644 index 0000000000..4b24b72bbe --- /dev/null +++ b/tests/core/snapshots/with-args.md_client.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Query { + user(id: Int!): [User] +} + +scalar Url + +type User { + name: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/with-args.md_merged.snap b/tests/core/snapshots/with-args.md_merged.snap new file mode 100644 index 0000000000..8d4d6edafd --- /dev/null +++ b/tests/core/snapshots/with-args.md_merged.snap @@ -0,0 +1,15 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream { + query: Query +} + +type Query { + user(id: Int!): [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) +} + +type User { + name: String +} diff --git a/tests/core/snapshots/with-nesting.md_0.snap b/tests/core/snapshots/with-nesting.md_0.snap new file mode 100644 index 0000000000..29d1a1dfea --- /dev/null +++ b/tests/core/snapshots/with-nesting.md_0.snap @@ -0,0 +1,27 @@ +--- +source: tests/core/spec.rs +expression: response +--- +{ + "status": 200, + "headers": { + "content-type": "application/json" + }, + "body": { + "data": { + "user": { + "posts": [ + { + "title": "title1" + }, + { + "title": "title2" + }, + { + "title": "title3" + } + ] + } + } + } +} diff --git a/tests/core/snapshots/with-nesting.md_client.snap b/tests/core/snapshots/with-nesting.md_client.snap new file mode 100644 index 0000000000..762317c8a7 --- /dev/null +++ b/tests/core/snapshots/with-nesting.md_client.snap @@ -0,0 +1,40 @@ +--- +source: tests/core/spec.rs +expression: client +--- +scalar Date + +scalar Email + +scalar Empty + +scalar JSON + +scalar PhoneNumber + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + user: User +} + +scalar Url + +type User { + email: String! + id: Int! + name: String! + phone: String + posts: [Post] + username: String! + website: String +} + +schema { + query: Query +} diff --git a/tests/core/snapshots/with-nesting.md_merged.snap b/tests/core/snapshots/with-nesting.md_merged.snap new file mode 100644 index 0000000000..5a3a7c2cb0 --- /dev/null +++ b/tests/core/snapshots/with-nesting.md_merged.snap @@ -0,0 +1,28 @@ +--- +source: tests/core/spec.rs +expression: merged +--- +schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { + query: Query +} + +type Post { + body: String + id: Int + title: String + userId: Int +} + +type Query { + user: User @http(path: "/users/1") +} + +type User { + email: String! + id: Int! + name: String! + phone: String + posts: [Post] @http(path: "/users/{{.value.id}}/posts") + username: String! + website: String +} diff --git a/tests/core/spec.rs b/tests/core/spec.rs new file mode 100644 index 0000000000..1d8ff01960 --- /dev/null +++ b/tests/core/spec.rs @@ -0,0 +1,323 @@ +extern crate core; + +use std::collections::BTreeMap; +use std::path::Path; +use std::sync::Arc; +use std::{fs, panic}; + +use anyhow::Context; +use colored::Colorize; +use futures_util::future::join_all; +use hyper::{Body, Request}; +use serde::{Deserialize, Serialize}; +use tailcall::async_graphql_hyper::{GraphQLBatchRequest, GraphQLRequest}; +use tailcall::blueprint::Blueprint; +use tailcall::config::reader::ConfigReader; +use tailcall::config::{Config, ConfigModule, Source}; +use tailcall::http::{handle_request, AppContext}; +use tailcall::merge_right::MergeRight; +use tailcall::print_schema::print_schema; +use tailcall::valid::{Cause, ValidationError, Validator as _}; + +use super::file::File; +use super::http::Http; +use super::model::*; +use super::runtime::ExecutionSpec; +use crate::core::runtime; + +#[derive(Debug, Default, Deserialize, Serialize, PartialEq)] +struct SDLError { + message: String, + trace: Vec, + description: Option, +} + +impl<'a> From> for SDLError { + fn from(value: Cause<&'a str>) -> Self { + SDLError { + message: value.message.to_string(), + trace: value.trace.iter().map(|e| e.to_string()).collect(), + description: None, + } + } +} + +impl From> for SDLError { + fn from(value: Cause) -> Self { + SDLError { + message: value.message.to_string(), + trace: value.trace.iter().map(|e| e.to_string()).collect(), + description: value.description, + } + } +} + +async fn is_sdl_error(spec: ExecutionSpec, mock_http_client: Arc) -> bool { + if spec.sdl_error { + // errors: errors are expected, make sure they match + let (source, content) = &spec.server[0]; + + if !matches!(source, Source::GraphQL) { + panic!("Cannot use \"sdl error\" directive with a non-GraphQL server block."); + } + + let config = Config::from_sdl(content).to_result(); + + let config = match config { + Ok(config) => { + let mut runtime = runtime::create_runtime(mock_http_client, spec.env.clone(), None); + runtime.file = Arc::new(File::new(spec.clone())); + let reader = ConfigReader::init(runtime); + match reader.resolve(config, spec.path.parent()).await { + Ok(config) => Blueprint::try_from(&config), + Err(e) => Err(ValidationError::new(e.to_string())), + } + } + Err(e) => Err(e), + }; + + match config { + Ok(_) => { + tracing::error!("\terror FAIL"); + panic!( + "Spec {} {:?} with \"sdl error\" directive did not have a validation error.", + spec.name, spec.path + ); + } + Err(cause) => { + let errors: Vec = + cause.as_vec().iter().map(|e| e.to_owned().into()).collect(); + + let snapshot_name = format!("execution_spec__{}_errors", spec.safe_name); + + insta::assert_json_snapshot!(snapshot_name, errors); + } + }; + + return true; + } + false +} + +async fn check_server_config(spec: ExecutionSpec) -> Vec { + let mut server: Vec = Vec::with_capacity(spec.server.len()); + + for (i, (source, content)) in spec.server.iter().enumerate() { + let config = Config::from_source(source.to_owned(), content).unwrap_or_else(|e| { + panic!( + "Couldn't parse GraphQL in server definition #{} of {:#?}: {}", + i + 1, + spec.path, + e + ) + }); + + let config = Config::default().merge_right(config); + + // TODO: we should probably figure out a way to do this for every test + // but GraphQL identity checking is very hard, since a lot depends on the code + // style the re-serializing check gives us some of the advantages of the + // identity check too, but we are missing out on some by having it only + // enabled for either new tests that request it or old graphql_spec + // tests that were explicitly written with it in mind + if spec.check_identity { + if matches!(source, Source::GraphQL) { + let identity = config.to_sdl(); + + // \r is added automatically in windows, it's safe to replace it with \n + let content = content.replace("\r\n", "\n"); + + let path_str = spec.path.display().to_string(); + + let identity = tailcall_prettier::format( + identity, + tailcall_prettier::Parser::detect(path_str.as_str()).unwrap(), + ) + .await + .unwrap(); + + let content = tailcall_prettier::format( + content, + tailcall_prettier::Parser::detect(path_str.as_str()).unwrap(), + ) + .await + .unwrap(); + + pretty_assertions::assert_eq!( + identity, + content, + "Identity check failed for {:#?}", + spec.path, + ); + } else { + panic!( + "Spec {:#?} has \"check identity\" enabled, but its config isn't in GraphQL.", + spec.path + ); + } + } + + server.push(config); + } + server +} + +async fn run_query_tests_on_spec( + spec: ExecutionSpec, + server: Vec, + mock_http_client: Arc, +) { + if let Some(tests) = spec.test.as_ref() { + let app_ctx = spec + .app_context( + server.first().unwrap(), + spec.env.clone().unwrap_or_default(), + mock_http_client.clone(), + ) + .await; + + // test: Run test specs + + for (i, test) in tests.iter().enumerate() { + let response = run_test(app_ctx.clone(), test) + .await + .context(spec.path.to_str().unwrap().to_string()) + .unwrap(); + + let mut headers: BTreeMap = BTreeMap::new(); + + for (key, value) in response.headers() { + headers.insert(key.to_string(), value.to_str().unwrap().to_string()); + } + + let response: APIResponse = APIResponse { + status: response.status().clone().as_u16(), + headers, + body: serde_json::from_slice( + &hyper::body::to_bytes(response.into_body()).await.unwrap(), + ) + .unwrap_or(serde_json::Value::Null), + text_body: None, + }; + + let snapshot_name = format!("{}_{}", spec.safe_name, i); + + insta::assert_json_snapshot!(snapshot_name, response); + } + + mock_http_client.test_hits(&spec.path); + } +} + +async fn test_spec(spec: ExecutionSpec) { + // insta settings + let mut insta_settings = insta::Settings::clone_current(); + insta_settings.set_prepend_module_to_snapshot(false); + let _guard = insta::Settings::bind_to_scope(&insta_settings); + + let mock_http_client = Arc::new(Http::new(&spec)); + + // check sdl error if any + if is_sdl_error(spec.clone(), mock_http_client.clone()).await { + return; + } + + // Parse and validate all server configs + check for identity + let server = check_server_config(spec.clone()).await; + + // merged: Run merged specs + let merged = server + .iter() + .fold(Config::default(), |acc, c| acc.merge_right(c.clone())) + .to_sdl(); + + let snapshot_name = format!("{}_merged", spec.safe_name); + + insta::assert_snapshot!(snapshot_name, merged); + + // Resolve all configs + let mut runtime = runtime::create_runtime(mock_http_client.clone(), spec.env.clone(), None); + runtime.file = Arc::new(File::new(spec.clone())); + let reader = ConfigReader::init(runtime); + + let server: Vec = join_all( + server + .into_iter() + .map(|config| reader.resolve(config, spec.path.parent())), + ) + .await + .into_iter() + .enumerate() + .map(|(i, result)| { + result.unwrap_or_else(|e| { + panic!( + "Couldn't resolve GraphQL in server definition #{} of {:#?}: {}", + i + 1, + spec.path, + e + ) + }) + }) + .collect(); + + // client: Check if client spec matches snapshot + if server.len() == 1 { + let config = &server[0]; + + let client = print_schema( + (Blueprint::try_from(config) + .context(format!("file: {}", spec.path.to_str().unwrap())) + .unwrap()) + .to_schema(), + ); + let snapshot_name = format!("{}_client", spec.safe_name); + + insta::assert_snapshot!(snapshot_name, client); + } + + // run query tests + run_query_tests_on_spec(spec, server, mock_http_client).await; +} + +pub async fn load_and_test_execution_spec(path: &Path) -> anyhow::Result<()> { + let contents = fs::read_to_string(path)?; + let spec: ExecutionSpec = ExecutionSpec::from_source(path, contents) + .await + .with_context(|| path.display().to_string())?; + + match spec.runner { + Some(Annotation::Skip) => { + println!("{} ... {}", spec.path.display(), "skipped".blue()); + } + Some(Annotation::Only) => {} + None => test_spec(spec).await, + } + + Ok(()) +} + +async fn run_test( + app_ctx: Arc, + request: &APIRequest, +) -> anyhow::Result> { + let query_string = serde_json::to_string(&request.body).expect("body is required"); + let method = request.method.clone(); + let headers = request.headers.clone(); + let url = request.url.clone(); + let req = headers + .into_iter() + .fold( + Request::builder() + .method(method.to_hyper()) + .uri(url.as_str()), + |acc, (key, value)| acc.header(key, value), + ) + .body(Body::from(query_string))?; + + // TODO: reuse logic from server.rs to select the correct handler + if app_ctx.blueprint.server.enable_batch_requests { + handle_request::(req, app_ctx).await + } else { + handle_request::(req, app_ctx).await + } +} diff --git a/tests/execution_spec.rs b/tests/execution_spec.rs index 9175e4789f..7d279ecf2f 100644 --- a/tests/execution_spec.rs +++ b/tests/execution_spec.rs @@ -1,1099 +1,12 @@ -extern crate core; +mod core; -mod telemetry; +use core::spec::load_and_test_execution_spec; +use std::path::Path; -use std::borrow::Cow; -use std::collections::{BTreeMap, HashMap}; -use std::path::{Path, PathBuf}; -use std::str::FromStr; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, Once}; -use std::{fs, panic}; +fn run_execution_spec(path: &Path) -> datatest_stable::Result<()> { + let result = tokio_test::block_on(load_and_test_execution_spec(path)); -use anyhow::{anyhow, Context}; -use derive_setters::Setters; -use futures_util::future::join_all; -use hyper::body::Bytes; -use hyper::{Body, Request}; -use markdown::mdast::Node; -use markdown::ParseOptions; -use reqwest::header::{HeaderName, HeaderValue}; -use serde::{Deserialize, Serialize}; -use serde_json::Value; -use tailcall::async_graphql_hyper::{GraphQLBatchRequest, GraphQLRequest}; -use tailcall::blueprint::{self, Blueprint}; -use tailcall::cache::InMemoryCache; -use tailcall::cli::javascript; -use tailcall::cli::metrics::init_metrics; -use tailcall::config::reader::ConfigReader; -use tailcall::config::{Config, ConfigModule, Source}; -use tailcall::http::{handle_request, AppContext, Method, Response}; -use tailcall::merge_right::MergeRight; -use tailcall::print_schema::print_schema; -use tailcall::runtime::TargetRuntime; -use tailcall::valid::{Cause, ValidationError, Validator as _}; -use tailcall::{EnvIO, FileIO, HttpIO}; -use telemetry::in_memory::InMemoryTelemetry; -use telemetry::init::init_opentelemetry; -use url::Url; - -#[cfg(test)] -pub mod test { - use std::borrow::Cow; - use std::collections::HashMap; - use std::sync::Arc; - - use anyhow::anyhow; - use tailcall::cache::InMemoryCache; - use tailcall::cli::javascript; - use tailcall::runtime::TargetRuntime; - use tokio::io::{AsyncReadExt, AsyncWriteExt}; - - use crate::{blueprint, EnvIO, FileIO, MockHttpClient}; - - #[derive(Clone)] - struct TestFileIO {} - - impl TestFileIO { - fn init() -> Self { - TestFileIO {} - } - } - - #[async_trait::async_trait] - impl FileIO for TestFileIO { - async fn write<'a>(&'a self, path: &'a str, content: &'a [u8]) -> anyhow::Result<()> { - let mut file = tokio::fs::File::create(path).await?; - file.write_all(content) - .await - .map_err(|e| anyhow!("{}", e))?; - Ok(()) - } - - async fn read<'a>(&'a self, path: &'a str) -> anyhow::Result { - let mut file = tokio::fs::File::open(path).await?; - let mut buffer = Vec::new(); - file.read_to_end(&mut buffer) - .await - .map_err(|e| anyhow!("{}", e))?; - Ok(String::from_utf8(buffer)?) - } - } - - #[derive(Clone)] - struct TestEnvIO { - vars: HashMap, - } - - impl EnvIO for TestEnvIO { - fn get(&self, key: &str) -> Option> { - self.vars.get(key).map(Cow::from) - } - } - - impl TestEnvIO { - pub fn init(vars: Option>) -> Self { - Self { vars: vars.unwrap_or_default() } - } - } - - pub fn create_runtime( - http_client: Arc, - env: Option>, - script: Option, - ) -> TargetRuntime { - let http = if let Some(script) = script.clone() { - javascript::init_http(http_client.clone(), script) - } else { - http_client.clone() - }; - - let http2 = if let Some(script) = script { - javascript::init_http(http_client.clone(), script) - } else { - http_client.clone() - }; - - let file = TestFileIO::init(); - let env = TestEnvIO::init(env); - - TargetRuntime { - http, - http2_only: http2, - env: Arc::new(env), - file: Arc::new(file), - cache: Arc::new(InMemoryCache::new()), - extensions: Arc::new(vec![]), - } - } -} - -static INIT: Once = Once::new(); - -#[derive(Serialize, Deserialize, Clone, Debug)] -#[serde(rename_all = "camelCase")] -enum Annotation { - Skip, - Only, -} - -#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] -struct APIRequest { - #[serde(default)] - method: Method, - url: Url, - #[serde(default)] - headers: BTreeMap, - #[serde(default)] - body: serde_json::Value, - #[serde(default)] - assert_traces: bool, - #[serde(default)] - assert_metrics: bool, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -#[serde(rename_all = "camelCase")] -struct APIResponse { - #[serde(default = "default_status")] - status: u16, - #[serde(default)] - headers: BTreeMap, - #[serde(default)] - body: serde_json::Value, - #[serde(default)] - #[serde(skip_serializing_if = "Option::is_none")] - text_body: Option, -} - -pub struct Env { - env: HashMap, -} - -impl EnvIO for Env { - fn get(&self, key: &str) -> Option> { - self.env.get(key).map(Cow::from) - } -} - -impl Env { - pub fn init(map: HashMap) -> Self { - Self { env: map } - } -} - -fn default_status() -> u16 { - 200 -} - -fn default_expected_hits() -> usize { - 1 -} - -#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] -struct UpstreamRequest(APIRequest); - -#[derive(Serialize, Deserialize, Clone, Debug)] -struct UpstreamResponse(APIResponse); - -#[derive(Serialize, Deserialize, Clone, Debug)] -#[serde(rename_all = "camelCase")] -enum ConfigSource { - File(String), - Inline(Config), -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -struct Mock { - request: UpstreamRequest, - response: UpstreamResponse, - #[serde(default = "default_expected_hits")] - expected_hits: usize, -} - -#[derive(Debug, Default, Deserialize, Serialize, PartialEq)] -struct SDLError { - message: String, - trace: Vec, - description: Option, -} - -impl<'a> From> for SDLError { - fn from(value: Cause<&'a str>) -> Self { - SDLError { - message: value.message.to_string(), - trace: value.trace.iter().map(|e| e.to_string()).collect(), - description: None, - } - } -} - -impl From> for SDLError { - fn from(value: Cause) -> Self { - SDLError { - message: value.message.to_string(), - trace: value.trace.iter().map(|e| e.to_string()).collect(), - description: value.description, - } - } -} - -#[derive(Clone, Setters)] -struct ExecutionSpec { - path: PathBuf, - name: String, - safe_name: String, - - server: Vec<(Source, String)>, - mock: Option>, - env: Option>, - test: Option>, - files: BTreeMap, - - // Annotations for the runner - runner: Option, - - check_identity: bool, - sdl_error: bool, -} - -impl ExecutionSpec { - async fn cargo_read(path: &str) -> anyhow::Result> { - let dir_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join(path) - .canonicalize()?; - let mut files = Vec::new(); - - for entry in fs::read_dir(&dir_path)? { - let path = entry?.path(); - if path.is_dir() { - continue; - } - if path.is_file() { - if let Some(ext) = path.extension().and_then(|x| x.to_str()) { - if ext == "md" { - let contents = fs::read_to_string(&path)?; - let spec: ExecutionSpec = Self::from_source(&path, contents) - .await - .map_err(|err| err.context(path.to_str().unwrap().to_string()))?; - - files.push(spec.path(path)); - } - } - } - } - - assert!( - !files.is_empty(), - "No files found in {}", - dir_path.to_str().unwrap_or_default() - ); - Ok(files) - } - - fn filter_specs(specs: Vec) -> Vec { - let mut only_specs = Vec::new(); - let mut filtered_specs = Vec::new(); - - for spec in specs { - match spec.runner { - Some(Annotation::Skip) => { - tracing::warn!("{} {} ... skipped", spec.name, spec.path.display()) - } - Some(Annotation::Only) => only_specs.push(spec), - None => filtered_specs.push(spec), - } - } - - // If any spec has the Only annotation, use those; otherwise, use the filtered - // list. - if !only_specs.is_empty() { - only_specs - } else { - filtered_specs - } - } - - async fn from_source(path: &Path, contents: String) -> anyhow::Result { - INIT.call_once(|| {}); - - let ast = markdown::to_mdast(&contents, &ParseOptions::default()).unwrap(); - let mut children = ast - .children() - .unwrap_or_else(|| panic!("Failed to parse {:?}: empty file unexpected", path)) - .iter() - .peekable(); - - let mut name: Option = None; - let mut server: Vec<(Source, String)> = Vec::with_capacity(2); - let mut mock: Option> = None; - let mut env: Option> = None; - let mut files: BTreeMap = BTreeMap::new(); - let mut test: Option> = None; - let mut runner: Option = None; - let mut check_identity = false; - let mut sdl_error = false; - - while let Some(node) = children.next() { - match node { - Node::Heading(heading) => { - if heading.depth == 1 { - // Parse test name - if name.is_none() { - if let Some(Node::Text(text)) = heading.children.first() { - name = Some(text.value.clone()); - } else { - return Err(anyhow!( - "Unexpected content of level 1 heading in {:?}: {:#?}", - path, - heading - )); - } - } else { - return Err(anyhow!( - "Unexpected double-declaration of test name in {:?}", - path - )); - } - - // Consume optional test description - if let Some(Node::Paragraph(_)) = children.peek() { - let _ = children.next(); - } - } else if heading.depth == 2 { - if let Some(Node::Text(expect)) = heading.children.first() { - let split = expect.value.splitn(2, ':').collect::>(); - match split[..] { - [a, b] => { - check_identity = - a.contains("check_identity") && b.ends_with("true"); - sdl_error = a.contains("expect_validation_error") - && b.ends_with("true"); - } - _ => { - return Err(anyhow!( - "Unexpected header annotation {:?} in {:?}", - expect.value, - path, - )) - } - } - } - } else if heading.depth == 5 { - // Parse annotation - if runner.is_none() { - if let Some(Node::Text(text)) = heading.children.first() { - runner = Some(match text.value.as_str() { - "skip" => Annotation::Skip, - "only" => Annotation::Only, - _ => { - return Err(anyhow!( - "Unexpected runner annotation {:?} in {:?}", - text.value, - path, - )); - } - }); - } else { - return Err(anyhow!( - "Unexpected content of level 5 heading in {:?}: {:#?}", - path, - heading - )); - } - } else { - return Err(anyhow!( - "Unexpected double-declaration of runner annotation in {:?}", - path - )); - } - } else if heading.depth == 4 { - } else { - return Err(anyhow!( - "Unexpected level {} heading in {:?}: {:#?}", - heading.depth, - path, - heading - )); - } - } - Node::Code(code) => { - // Parse following code block - let (content, lang, meta) = { - ( - code.value.to_owned(), - code.lang.to_owned(), - code.meta.to_owned(), - ) - }; - if let Some(meta_str) = meta.as_ref().filter(|s| s.contains('@')) { - let temp_cleaned_meta = meta_str.replace('@', ""); - let name: &str = &temp_cleaned_meta; - if let Some(name) = name.strip_prefix("file:") { - if files.insert(name.to_string(), content).is_some() { - return Err(anyhow!( - "Double declaration of file {:?} in {:#?}", - name, - path - )); - } - } else { - let lang = match lang { - Some(x) => Ok(x), - None => Err(anyhow!( - "Unexpected code block with no specific language in {:?}", - path - )), - }?; - - let source = Source::from_str(&lang)?; - - match name { - "server" => { - // Server configs are only parsed if the test isn't skipped. - server.push((source, content)); - } - "mock" => { - if mock.is_none() { - mock = match source { - Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), - _ => Err(anyhow!("Unexpected language in mock block in {:?} (only JSON and YAML are supported)", path)), - }?; - } else { - return Err(anyhow!("Unexpected number of mock blocks in {:?} (only one is allowed)", path)); - } - } - "env" => { - if env.is_none() { - env = match source { - Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), - _ => Err(anyhow!("Unexpected language in env block in {:?} (only JSON and YAML are supported)", path)), - }?; - } else { - return Err(anyhow!("Unexpected number of env blocks in {:?} (only one is allowed)", path)); - } - } - "test" => { - if test.is_none() { - test = match source { - Source::Json => Ok(serde_json::from_str(&content)?), - Source::Yml => Ok(serde_yaml::from_str(&content)?), - _ => Err(anyhow!("Unexpected language in test block in {:?} (only JSON and YAML are supported)", path)), - }?; - } else { - return Err(anyhow!("Unexpected number of test blocks in {:?} (only one is allowed)", path)); - } - } - _ => { - return Err(anyhow!( - "Unexpected component {:?} in {:?}: {:#?}", - name, - path, - meta - )); - } - } - } - } else { - return Err(anyhow!( - "Unexpected content of code in {:?}: {:#?}", - path, - meta - )); - } - } - Node::Definition(d) => { - if let Some(title) = &d.title { - tracing::info!("Comment found in: {:?} with title: {}", path, title); - } - } - Node::ThematicBreak(_) => { - // skip this for and put execute logic in heading.depth - // above to escape ThematicBreaks like - // `---`, `***` or `___` - } - _ => return Err(anyhow!("Unexpected node in {:?}: {:#?}", path, node)), - } - } - - if server.is_empty() { - return Err(anyhow!( - "Unexpected blocks in {:?}: You must define a GraphQL Config in an execution test.", - path, - )); - } - - let spec = ExecutionSpec { - path: path.to_owned(), - name: name.unwrap_or_else(|| path.file_name().unwrap().to_str().unwrap().to_string()), - safe_name: path.file_name().unwrap().to_str().unwrap().to_string(), - - server, - mock, - env, - test, - files, - - runner, - check_identity, - sdl_error, - }; - - anyhow::Ok(spec) - } - - async fn app_context( - &self, - config: &ConfigModule, - env: HashMap, - http_client: Arc, - ) -> Arc { - let blueprint = Blueprint::try_from(config).unwrap(); - let http = if let Some(script) = blueprint.server.script.clone() { - javascript::init_http(http_client, script) - } else { - http_client - }; - - let http2_only = http.clone(); - - let runtime = TargetRuntime { - http, - http2_only, - file: Arc::new(MockFileSystem::new(self.clone())), - env: Arc::new(Env::init(env)), - cache: Arc::new(InMemoryCache::new()), - extensions: Arc::new(vec![]), - }; - - // TODO: move inside tailcall core if possible - init_metrics(&runtime).unwrap(); - - let endpoints = config - .extensions - .endpoint_set - .clone() - .into_checked(&blueprint, runtime.clone()) - .await - .unwrap(); - - Arc::new(AppContext::new(blueprint, runtime, endpoints)) - } -} - -#[derive(Clone, Debug)] -struct ExecutionMock { - mock: Mock, - actual_hits: Arc, -} - -impl ExecutionMock { - fn assert_hits(&self, path: impl AsRef) { - let url = &self.mock.request.0.url; - let is_batch_graphql = url.path().starts_with("/graphql") - && self - .mock - .request - .0 - .body - .as_str() - .map(|s| s.contains(',')) - .unwrap_or_default(); - - // do not assert hits for mocks for batch graphql requests - // since that requires having 2 mocks with different order of queries in - // single request and only one of that mocks is actually called during run. - // for other protocols there is no issues right now, because: - // - for http the keys are always sorted https://github.com/tailcallhq/tailcall/blob/51d8b7aff838f0f4c362d4ee9e39492ae1f51fdb/src/http/data_loader.rs#L71 - // - for grpc body is not used for matching the mock and grpc will use grouping based on id https://github.com/tailcallhq/tailcall/blob/733b641c41f17c60b15b36b025b4db99d0f9cdcd/tests/execution_spec.rs#L769 - if is_batch_graphql { - return; - } - - let expected_hits = self.mock.expected_hits; - let actual_hits = self.actual_hits.load(Ordering::Relaxed); - - assert_eq!( - expected_hits, - actual_hits, - "expected mock for {url} to be hit exactly {expected_hits} times, but it was hit {actual_hits} times for file: {:?}", - path.as_ref() - ); - } + Ok(result?) } -#[derive(Clone, Debug)] -pub struct MockHttpClient { - mocks: Vec, - spec_path: String, -} - -impl MockHttpClient { - fn new(spec: &ExecutionSpec) -> Self { - let mocks = spec - .mock - .as_ref() - .map(|mocks| { - mocks - .iter() - .map(|mock| ExecutionMock { - mock: mock.clone(), - actual_hits: Arc::new(AtomicUsize::default()), - }) - .collect() - }) - .unwrap_or_default(); - - let spec_path = spec - .path - .strip_prefix(std::env::current_dir().unwrap()) - .unwrap_or(&spec.path) - .to_string_lossy() - .into_owned(); - - MockHttpClient { mocks, spec_path } - } - - fn assert_hits(&self, path: impl AsRef) { - for mock in &self.mocks { - mock.assert_hits(path.as_ref()); - } - } -} - -fn string_to_bytes(input: &str) -> Vec { - let mut bytes = Vec::new(); - let mut chars = input.chars().peekable(); - - while let Some(c) = chars.next() { - match c { - '\\' => match chars.next() { - Some('0') => bytes.push(0), - Some('n') => bytes.push(b'\n'), - Some('t') => bytes.push(b'\t'), - Some('r') => bytes.push(b'\r'), - Some('\\') => bytes.push(b'\\'), - Some('\"') => bytes.push(b'\"'), - Some('x') => { - let mut hex = chars.next().unwrap().to_string(); - hex.push(chars.next().unwrap()); - let byte = u8::from_str_radix(&hex, 16).unwrap(); - bytes.push(byte); - } - _ => panic!("Unsupported escape sequence"), - }, - _ => bytes.push(c as u8), - } - } - - bytes -} - -#[async_trait::async_trait] -impl HttpIO for MockHttpClient { - async fn execute(&self, req: reqwest::Request) -> anyhow::Result> { - // Determine if the request is a GRPC request based on PORT - let is_grpc = req.url().as_str().contains("50051"); - - // Try to find a matching mock for the incoming request. - let execution_mock = self - .mocks - .iter() - .find(|mock| { - let mock_req = &mock.mock.request; - let method_match = req.method() == mock_req.0.method.clone().to_hyper(); - let url_match = req.url().as_str() == mock_req.0.url.clone().as_str(); - let req_body = match req.body() { - Some(body) => { - if let Some(bytes) = body.as_bytes() { - if let Ok(body_str) = std::str::from_utf8(bytes) { - Value::from(body_str) - } else { - Value::Null - } - } else { - Value::Null - } - } - None => Value::Null, - }; - let body_match = req_body == mock_req.0.body; - let headers_match = req - .headers() - .iter() - .filter(|(key, _)| *key != "content-type") - .all(|(key, value)| { - let header_name = key.to_string(); - - let header_value = value.to_str().unwrap(); - let mock_header_value = "".to_string(); - let mock_header_value = mock_req - .0 - .headers - .get(&header_name) - .unwrap_or(&mock_header_value); - header_value == mock_header_value - }); - method_match && url_match && headers_match && (body_match || is_grpc) - }) - .ok_or(anyhow!( - "No mock found for request: {:?} {} in {}", - req.method(), - req.url(), - self.spec_path - ))?; - - execution_mock.actual_hits.fetch_add(1, Ordering::Relaxed); - - // Clone the response from the mock to avoid borrowing issues. - let mock_response = execution_mock.mock.response.clone(); - - // Build the response with the status code from the mock. - let status_code = reqwest::StatusCode::from_u16(mock_response.0.status)?; - - if status_code.is_client_error() || status_code.is_server_error() { - return Err(anyhow::format_err!("Status code error")); - } - - let mut response = Response { status: status_code, ..Default::default() }; - - // Insert headers from the mock into the response. - for (key, value) in mock_response.0.headers { - let header_name = HeaderName::from_str(&key)?; - let header_value = HeaderValue::from_str(&value)?; - response.headers.insert(header_name, header_value); - } - - // Special Handling for GRPC - if let Some(body) = mock_response.0.text_body { - // Return plaintext body if specified - let body = string_to_bytes(&body); - response.body = Bytes::from_iter(body); - } else if is_grpc { - // Special Handling for GRPC - let body = string_to_bytes(mock_response.0.body.as_str().unwrap_or_default()); - response.body = Bytes::from_iter(body); - } else { - let body = serde_json::to_vec(&mock_response.0.body)?; - response.body = Bytes::from_iter(body); - } - - Ok(response) - } -} - -struct MockFileSystem { - spec: ExecutionSpec, -} - -impl MockFileSystem { - fn new(spec: ExecutionSpec) -> MockFileSystem { - MockFileSystem { spec } - } -} - -#[async_trait::async_trait] -impl FileIO for MockFileSystem { - async fn write<'a>(&'a self, _path: &'a str, _content: &'a [u8]) -> anyhow::Result<()> { - Err(anyhow!("Cannot write to a file in an execution spec")) - } - - async fn read<'a>(&'a self, path: &'a str) -> anyhow::Result { - let base = PathBuf::from(path); - let path = base - .file_name() - .context("Invalid file path")? - .to_str() - .context("Invalid OsString")?; - match self.spec.files.get(path) { - Some(x) => Ok(x.to_owned()), - None => Err(anyhow!("No such file or directory (os error 2)")), - } - } -} - -async fn test_spec(spec: ExecutionSpec, opentelemetry: &InMemoryTelemetry) { - let mock_http_client = Arc::new(MockHttpClient::new(&spec)); - // Parse and validate all server configs + check for identity - - if spec.sdl_error { - // errors: errors are expected, make sure they match - let (source, content) = &spec.server[0]; - - if !matches!(source, Source::GraphQL) { - panic!("Cannot use \"sdl error\" directive with a non-GraphQL server block."); - } - - let config = Config::from_sdl(content).to_result(); - - let config = match config { - Ok(config) => { - let mut runtime = test::create_runtime(mock_http_client, spec.env.clone(), None); - runtime.file = Arc::new(MockFileSystem::new(spec.clone())); - let reader = ConfigReader::init(runtime); - match reader.resolve(config, spec.path.parent()).await { - Ok(config) => Blueprint::try_from(&config), - Err(e) => Err(ValidationError::new(e.to_string())), - } - } - Err(e) => Err(e), - }; - - match config { - Ok(_) => { - tracing::error!("\terror FAIL"); - panic!( - "Spec {} {:?} with \"sdl error\" directive did not have a validation error.", - spec.name, spec.path - ); - } - Err(cause) => { - let errors: Vec = - cause.as_vec().iter().map(|e| e.to_owned().into()).collect(); - - let snapshot_name = format!("{}_errors", spec.safe_name); - - insta::assert_json_snapshot!(snapshot_name, errors); - } - }; - - return; - } - - let mut server: Vec = Vec::with_capacity(spec.server.len()); - - for (i, (source, content)) in spec.server.iter().enumerate() { - let config = Config::from_source(source.to_owned(), content).unwrap_or_else(|e| { - panic!( - "Couldn't parse GraphQL in server definition #{} of {:#?}: {}", - i + 1, - spec.path, - e - ) - }); - - let config = Config::default().merge_right(config); - - // TODO: we should probably figure out a way to do this for every test - // but GraphQL identity checking is very hard, since a lot depends on the code - // style the re-serializing check gives us some of the advantages of the - // identity check too, but we are missing out on some by having it only - // enabled for either new tests that request it or old graphql_spec - // tests that were explicitly written with it in mind - if spec.check_identity { - if matches!(source, Source::GraphQL) { - let identity = config.to_sdl(); - - // \r is added automatically in windows, it's safe to replace it with \n - let content = content.replace("\r\n", "\n"); - - let path_str = spec.path.display().to_string(); - - let identity = tailcall_prettier::format( - identity, - tailcall_prettier::Parser::detect(path_str.as_str()).unwrap(), - ) - .await - .unwrap(); - - let content = tailcall_prettier::format( - content, - tailcall_prettier::Parser::detect(path_str.as_str()).unwrap(), - ) - .await - .unwrap(); - - pretty_assertions::assert_eq!( - identity, - content, - "Identity check failed for {:#?}", - spec.path, - ); - } else { - panic!( - "Spec {:#?} has \"check identity\" enabled, but its config isn't in GraphQL.", - spec.path - ); - } - } - - server.push(config); - } - - // merged: Run merged specs - - let merged = server - .iter() - .fold(Config::default(), |acc, c| acc.merge_right(c.clone())) - .to_sdl(); - - let snapshot_name = format!("{}_merged", spec.safe_name); - - insta::assert_snapshot!(snapshot_name, merged); - // Resolve all configs - let mut runtime = test::create_runtime(mock_http_client.clone(), spec.env.clone(), None); - runtime.file = Arc::new(MockFileSystem::new(spec.clone())); - let reader = ConfigReader::init(runtime); - - let server: Vec = join_all( - server - .into_iter() - .map(|config| reader.resolve(config, spec.path.parent())), - ) - .await - .into_iter() - .enumerate() - .map(|(i, result)| { - result.unwrap_or_else(|e| { - panic!( - "Couldn't resolve GraphQL in server definition #{} of {:#?}: {}", - i + 1, - spec.path, - e - ) - }) - }) - .collect(); - - if server.len() == 1 { - let config = &server[0]; - - // client: Check if client spec matches snapshot - let client = print_schema( - (Blueprint::try_from(config) - .context(format!("file: {}", spec.path.to_str().unwrap())) - .unwrap()) - .to_schema(), - ); - let snapshot_name = format!("{}_client", spec.safe_name); - - insta::assert_snapshot!(snapshot_name, client); - } - - if let Some(test_spec) = spec.test.as_ref() { - let app_ctx = spec - .app_context( - server.first().unwrap(), - spec.env.clone().unwrap_or_default(), - mock_http_client.clone(), - ) - .await; - - // test: Run test specs - for (i, test) in test_spec.iter().enumerate() { - opentelemetry.reset(); - - let response = run_test(app_ctx.clone(), test) - .await - .context(spec.path.to_str().unwrap().to_string()) - .unwrap(); - - let mut headers: BTreeMap = BTreeMap::new(); - - for (key, value) in response.headers() { - headers.insert(key.to_string(), value.to_str().unwrap().to_string()); - } - - let response: APIResponse = APIResponse { - status: response.status().clone().as_u16(), - headers, - body: serde_json::from_slice( - &hyper::body::to_bytes(response.into_body()).await.unwrap(), - ) - .unwrap_or(serde_json::Value::Null), - text_body: None, - }; - - let snapshot_name = format!("{}_test_{}", spec.safe_name, i); - - insta::assert_json_snapshot!(snapshot_name, response); - - if test.assert_traces { - let snapshot_name = format!("{}_assert_traces_{}", spec.safe_name, i); - insta::assert_json_snapshot!(snapshot_name, opentelemetry.get_traces().unwrap()); - } - - if test.assert_metrics { - let snapshot_name = format!("{}_assert_metrics_{}", spec.safe_name, i); - insta::assert_json_snapshot!( - snapshot_name, - opentelemetry.get_metrics().await.unwrap() - ); - } - } - - mock_http_client.assert_hits(&spec.path); - } - - tracing::info!("{} ... ok", spec.path.display()); -} - -#[tokio::test] -async fn test() -> anyhow::Result<()> { - let opentelemetry = init_opentelemetry(); - // Explicitly only run one test if specified in command line args - // This is used by test-convertor to auto-apply the snapshots of incompatible - // fail-annotated http specs - - let args: Vec = std::env::args().collect(); - let expected_arg = ["insta", "i"]; - - let index = args - .iter() - .position(|arg| expected_arg.contains(&arg.as_str())) - .unwrap_or(usize::MAX); - - let spec = if index == usize::MAX { - let spec = ExecutionSpec::cargo_read("tests/execution").await?; - ExecutionSpec::filter_specs(spec) - } else { - let mut vec = vec![]; - let insta_values: Vec<&String> = args.iter().skip(index + 1).collect(); - for arg in insta_values { - let path = PathBuf::from(arg) - .canonicalize() - .unwrap_or_else(|_| panic!("Failed to parse explicit test path {:?}", arg)); - - let contents = fs::read_to_string(&path)?; - let spec: ExecutionSpec = ExecutionSpec::from_source(&path, contents) - .await - .map_err(|err| err.context(path.to_str().unwrap().to_string()))?; - vec.push(spec); - } - vec - }; - - for spec in spec.into_iter() { - test_spec(spec, &opentelemetry).await; - } - - Ok(()) -} - -async fn run_test( - app_ctx: Arc, - request: &APIRequest, -) -> anyhow::Result> { - let query_string = serde_json::to_string(&request.body).expect("body is required"); - let method = request.method.clone(); - let headers = request.headers.clone(); - let url = request.url.clone(); - let req = headers - .into_iter() - .fold( - Request::builder() - .method(method.to_hyper()) - .uri(url.as_str()), - |acc, (key, value)| acc.header(key, value), - ) - .body(Body::from(query_string))?; - - // TODO: reuse logic from server.rs to select the correct handler - if app_ctx.blueprint.server.enable_batch_requests { - handle_request::(req, app_ctx).await - } else { - handle_request::(req, app_ctx).await - } -} +datatest_stable::harness!(run_execution_spec, "tests/execution", r"^.*\.md$"); diff --git a/tests/snapshots/execution_spec__add-field-index-list.md_client.snap b/tests/snapshots/execution_spec__add-field-index-list.md_client.snap deleted file mode 100644 index e61b7c1600..0000000000 --- a/tests/snapshots/execution_spec__add-field-index-list.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - username: String - users: [User] -} - -scalar Url - -type User { - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-index-list.md_merged.snap b/tests/snapshots/execution_spec__add-field-index-list.md_merged.snap deleted file mode 100644 index a99128757f..0000000000 --- a/tests/snapshots/execution_spec__add-field-index-list.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query @addField(name: "username", path: ["users", "0", "name"]) { - users: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__add-field-index-list.md_test_0.snap b/tests/snapshots/execution_spec__add-field-index-list.md_test_0.snap deleted file mode 100644 index 29d33382cd..0000000000 --- a/tests/snapshots/execution_spec__add-field-index-list.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "username": "Leanne Graham" - } - } -} diff --git a/tests/snapshots/execution_spec__add-field-many-list.md_client.snap b/tests/snapshots/execution_spec__add-field-many-list.md_client.snap deleted file mode 100644 index 2456ca4d9f..0000000000 --- a/tests/snapshots/execution_spec__add-field-many-list.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type A { - b: [String] - c: String - d: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - u: U -} - -type U { - a: A - b: [String] - c: String - d: String - e: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-many-list.md_merged.snap b/tests/snapshots/execution_spec__add-field-many-list.md_merged.snap deleted file mode 100644 index f01797ab15..0000000000 --- a/tests/snapshots/execution_spec__add-field-many-list.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type A { - b: [String] - c: String - d: String -} - -type Query { - u: U @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/us/1") -} - -type U @addField(name: "b", path: ["a", "b"]) @addField(name: "c", path: ["a", "c"]) @addField(name: "d", path: ["a", "d"]) { - a: A - e: String -} diff --git a/tests/snapshots/execution_spec__add-field-many.md_client.snap b/tests/snapshots/execution_spec__add-field-many.md_client.snap deleted file mode 100644 index df32ac0aab..0000000000 --- a/tests/snapshots/execution_spec__add-field-many.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -type Foo { - a: String - b: String - c: String - name: String - x: X -} - -scalar JSON - -scalar PhoneNumber - -type Query { - user: Foo -} - -scalar Url - -type X { - a: String - b: String - c: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-many.md_merged.snap b/tests/snapshots/execution_spec__add-field-many.md_merged.snap deleted file mode 100644 index 108c262739..0000000000 --- a/tests/snapshots/execution_spec__add-field-many.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Foo @addField(name: "a", path: ["x", "a"]) @addField(name: "b", path: ["x", "b"]) @addField(name: "c", path: ["x", "c"]) { - name: String - x: X -} - -type Query { - user: Foo @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type X { - a: String - b: String - c: String -} diff --git a/tests/snapshots/execution_spec__add-field-modify.md_client.snap b/tests/snapshots/execution_spec__add-field-modify.md_client.snap deleted file mode 100644 index 3c9c668b7c..0000000000 --- a/tests/snapshots/execution_spec__add-field-modify.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Address { - city: String - street: String - zipcode: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: Address - city: String - name: String - street: String - zipcode: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-modify.md_merged.snap b/tests/snapshots/execution_spec__add-field-modify.md_merged.snap deleted file mode 100644 index 4307019636..0000000000 --- a/tests/snapshots/execution_spec__add-field-modify.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - city: String - street: String - zipcode: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "street", path: ["address", "street"]) @addField(name: "city", path: ["address", "city"]) @addField(name: "zipcode", path: ["address", "zipcode"]) { - address: Address - name: String -} diff --git a/tests/snapshots/execution_spec__add-field-modify.md_test_0.snap b/tests/snapshots/execution_spec__add-field-modify.md_test_0.snap deleted file mode 100644 index 9b3aeaf49d..0000000000 --- a/tests/snapshots/execution_spec__add-field-modify.md_test_0.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "foo", - "street": "Kulas Light", - "city": "Gwenborough", - "zipcode": "92998-3874" - } - } - } -} diff --git a/tests/snapshots/execution_spec__add-field-with-composition.md_client.snap b/tests/snapshots/execution_spec__add-field-with-composition.md_client.snap deleted file mode 100644 index 9c29a08749..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-composition.md_client.snap +++ /dev/null @@ -1,39 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Address { - geo: Geo - street: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Geo { - lat: String - lng: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - lat: String - lng: String - user: User -} - -scalar Url - -type User { - address: Address -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-with-composition.md_merged.snap b/tests/snapshots/execution_spec__add-field-with-composition.md_merged.snap deleted file mode 100644 index ee4ebae19d..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-composition.md_merged.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - geo: Geo - street: String -} - -type Geo { - lat: String - lng: String -} - -type Query @addField(name: "lat", path: ["user", "address", "geo", "lat"]) @addField(name: "lng", path: ["user", "address", "geo", "lng"]) { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - address: Address -} diff --git a/tests/snapshots/execution_spec__add-field-with-composition.md_test_0.snap b/tests/snapshots/execution_spec__add-field-with-composition.md_test_0.snap deleted file mode 100644 index d017028cc6..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-composition.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "lat": "-37.3159" - } - } -} diff --git a/tests/snapshots/execution_spec__add-field-with-composition.md_test_1.snap b/tests/snapshots/execution_spec__add-field-with-composition.md_test_1.snap deleted file mode 100644 index d28ce3b731..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-composition.md_test_1.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "lng": "81.1496" - } - } -} diff --git a/tests/snapshots/execution_spec__add-field-with-modify.md_client.snap b/tests/snapshots/execution_spec__add-field-with-modify.md_client.snap deleted file mode 100644 index f77eddebb2..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-modify.md_client.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - person1: User - person2: User - user1: String - user2: String -} - -scalar Url - -type User { - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field-with-modify.md_merged.snap b/tests/snapshots/execution_spec__add-field-with-modify.md_merged.snap deleted file mode 100644 index 5ea9e91eca..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-modify.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query @addField(name: "user1", path: ["person1", "name"]) @addField(name: "user2", path: ["person2", "name"]) { - person1: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") - person2: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/2") -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__add-field-with-modify.md_test_0.snap b/tests/snapshots/execution_spec__add-field-with-modify.md_test_0.snap deleted file mode 100644 index 861c4f9743..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-modify.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user1": "Leanne Graham" - } - } -} diff --git a/tests/snapshots/execution_spec__add-field-with-modify.md_test_1.snap b/tests/snapshots/execution_spec__add-field-with-modify.md_test_1.snap deleted file mode 100644 index b5e02c082d..0000000000 --- a/tests/snapshots/execution_spec__add-field-with-modify.md_test_1.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user2": "Ervin Howell" - } - } -} diff --git a/tests/snapshots/execution_spec__add-field.md_client.snap b/tests/snapshots/execution_spec__add-field.md_client.snap deleted file mode 100644 index b858be18ec..0000000000 --- a/tests/snapshots/execution_spec__add-field.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Address { - geo: Geo -} - -scalar Date - -scalar Email - -scalar Empty - -type Geo { - lat: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: Address - lat: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__add-field.md_merged.snap b/tests/snapshots/execution_spec__add-field.md_merged.snap deleted file mode 100644 index 869fcbf812..0000000000 --- a/tests/snapshots/execution_spec__add-field.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - geo: Geo -} - -type Geo { - lat: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "lat", path: ["address", "geo", "lat"]) { - address: Address -} diff --git a/tests/snapshots/execution_spec__add-field.md_test_0.snap b/tests/snapshots/execution_spec__add-field.md_test_0.snap deleted file mode 100644 index bf508b8b0d..0000000000 --- a/tests/snapshots/execution_spec__add-field.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "lat": "-37.3159" - } - } - } -} diff --git a/tests/snapshots/execution_spec__apollo-tracing.md_client.snap b/tests/snapshots/execution_spec__apollo-tracing.md_client.snap deleted file mode 100644 index e0c36c9133..0000000000 --- a/tests/snapshots/execution_spec__apollo-tracing.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hello: String! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__apollo-tracing.md_merged.snap b/tests/snapshots/execution_spec__apollo-tracing.md_merged.snap deleted file mode 100644 index b21a8ec737..0000000000 --- a/tests/snapshots/execution_spec__apollo-tracing.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream { - query: Query -} - -type Query { - hello: String! @http(baseURL: "http://api.com", path: "/") -} diff --git a/tests/snapshots/execution_spec__apollo-tracing.md_test_0.snap b/tests/snapshots/execution_spec__apollo-tracing.md_test_0.snap deleted file mode 100644 index d79142407b..0000000000 --- a/tests/snapshots/execution_spec__apollo-tracing.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "hello": "hello" - } - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_client.snap b/tests/snapshots/execution_spec__auth-basic.md_client.snap deleted file mode 100644 index f3f258d58b..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_client.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - protectedType: ProtectedType -} - -type Nested { - name: String! - protected: String! -} - -scalar PhoneNumber - -type ProtectedType { - name: String! - nested: String! -} - -type Query { - nested: Nested! - protectedScalar: String! - protectedType: ProtectedType - scalar: String! -} - -scalar Url - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_merged.snap b/tests/snapshots/execution_spec__auth-basic.md_merged.snap deleted file mode 100644 index 0f94953b0f..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_merged.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { - query: Query - mutation: Mutation -} - -type Mutation { - protectedType: ProtectedType @http(baseURL: "http://upstream", path: "/protected") -} - -type Nested { - name: String! - protected: String! @protected -} - -type ProtectedType @protected { - name: String! - nested: String! -} - -type Query { - nested: Nested! @expr(body: {name: "nested name", protected: "protected nested"}) - protectedScalar: String! @expr(body: "data from protected scalar") @protected - protectedType: ProtectedType @expr(body: {name: "protected type name", nested: "protected type nested"}) - scalar: String! @expr(body: "data from public scalar") -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_0.snap b/tests/snapshots/execution_spec__auth-basic.md_test_0.snap deleted file mode 100644 index 23b23fc4c6..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_0.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "scalar": "data from public scalar", - "nested": { - "name": "nested name" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_1.snap b/tests/snapshots/execution_spec__auth-basic.md_test_1.snap deleted file mode 100644 index e5615af7a6..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_1.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Missing Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_2.snap b/tests/snapshots/execution_spec__auth-basic.md_test_2.snap deleted file mode 100644 index e6f8269b6c..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_2.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Invalid Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_3.snap b/tests/snapshots/execution_spec__auth-basic.md_test_3.snap deleted file mode 100644 index 0ca6d0f640..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_3.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "protectedScalar": "data from protected scalar", - "nested": { - "name": "nested name", - "protected": "protected nested" - }, - "protectedType": { - "name": "protected type name", - "nested": "protected type nested" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_4.snap b/tests/snapshots/execution_spec__auth-basic.md_test_4.snap deleted file mode 100644 index e5615af7a6..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_4.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Missing Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_5.snap b/tests/snapshots/execution_spec__auth-basic.md_test_5.snap deleted file mode 100644 index be4bc718b0..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_5.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "protectedType": { - "name": "mutation name", - "nested": "mutation nested" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-basic.md_test_6.snap b/tests/snapshots/execution_spec__auth-basic.md_test_6.snap deleted file mode 100644 index e6f8269b6c..0000000000 --- a/tests/snapshots/execution_spec__auth-basic.md_test_6.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Invalid Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_client.snap b/tests/snapshots/execution_spec__auth-jwt.md_client.snap deleted file mode 100644 index f3f258d58b..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_client.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - protectedType: ProtectedType -} - -type Nested { - name: String! - protected: String! -} - -scalar PhoneNumber - -type ProtectedType { - name: String! - nested: String! -} - -type Query { - nested: Nested! - protectedScalar: String! - protectedType: ProtectedType - scalar: String! -} - -scalar Url - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_merged.snap b/tests/snapshots/execution_spec__auth-jwt.md_merged.snap deleted file mode 100644 index 49a1a0bff5..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_merged.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream @link(id: "jwks", src: "jwks.json", type: Jwks) { - query: Query - mutation: Mutation -} - -type Mutation { - protectedType: ProtectedType @http(baseURL: "http://upstream", path: "/protected") -} - -type Nested { - name: String! - protected: String! @protected -} - -type ProtectedType @protected { - name: String! - nested: String! -} - -type Query { - nested: Nested! @expr(body: {name: "nested name", protected: "protected nested"}) - protectedScalar: String! @expr(body: "data from protected scalar") @protected - protectedType: ProtectedType @expr(body: {name: "protected type name", nested: "protected type nested"}) - scalar: String! @expr(body: "data from public scalar") -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_0.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_0.snap deleted file mode 100644 index 23b23fc4c6..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_0.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "scalar": "data from public scalar", - "nested": { - "name": "nested name" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_1.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_1.snap deleted file mode 100644 index e5615af7a6..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_1.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Missing Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_2.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_2.snap deleted file mode 100644 index 0ca6d0f640..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_2.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "protectedScalar": "data from protected scalar", - "nested": { - "name": "nested name", - "protected": "protected nested" - }, - "protectedType": { - "name": "protected type name", - "nested": "protected type nested" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_3.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_3.snap deleted file mode 100644 index e5615af7a6..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_3.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Missing Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_4.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_4.snap deleted file mode 100644 index be4bc718b0..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_4.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "protectedType": { - "name": "mutation name", - "nested": "mutation nested" - } - } - } -} diff --git a/tests/snapshots/execution_spec__auth-jwt.md_test_5.snap b/tests/snapshots/execution_spec__auth-jwt.md_test_5.snap deleted file mode 100644 index e6f8269b6c..0000000000 --- a/tests/snapshots/execution_spec__auth-jwt.md_test_5.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Authentication Failure: Invalid Authorization Header", - "locations": [ - { - "line": 2, - "column": 3 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__auth.md_client.snap b/tests/snapshots/execution_spec__auth.md_client.snap deleted file mode 100644 index b407a8d7e1..0000000000 --- a/tests/snapshots/execution_spec__auth.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - data: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__auth.md_merged.snap b/tests/snapshots/execution_spec__auth.md_merged.snap deleted file mode 100644 index 8957ba9339..0000000000 --- a/tests/snapshots/execution_spec__auth.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) @link(id: "jwks", src: "jwks.json", type: Jwks) { - query: Query -} - -type Query { - data: String @expr(body: "data") @protected -} diff --git a/tests/snapshots/execution_spec__batching-default.md_client.snap b/tests/snapshots/execution_spec__batching-default.md_client.snap deleted file mode 100644 index f8e5c29910..0000000000 --- a/tests/snapshots/execution_spec__batching-default.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching-default.md_merged.snap b/tests/snapshots/execution_spec__batching-default.md_merged.snap deleted file mode 100644 index 20184ded3e..0000000000 --- a/tests/snapshots/execution_spec__batching-default.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 10, headers: []}, httpCache: true) { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__batching-default.md_test_0.snap b/tests/snapshots/execution_spec__batching-default.md_test_0.snap deleted file mode 100644 index c95cface17..0000000000 --- a/tests/snapshots/execution_spec__batching-default.md_test_0.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user": { - "id": 1 - }, - "userId": 1 - }, - { - "user": { - "id": 2 - }, - "userId": 2 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__batching-disabled.md_client.snap b/tests/snapshots/execution_spec__batching-disabled.md_client.snap deleted file mode 100644 index e6b70532b1..0000000000 --- a/tests/snapshots/execution_spec__batching-disabled.md_client.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int - name: String - username: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching-disabled.md_merged.snap b/tests/snapshots/execution_spec__batching-disabled.md_merged.snap deleted file mode 100644 index 1d1421b372..0000000000 --- a/tests/snapshots/execution_spec__batching-disabled.md_merged.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 0, headers: [], maxSize: 100}, httpCache: true) { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/{{.args.id}}") -} - -type User { - id: Int - name: String - username: String -} diff --git a/tests/snapshots/execution_spec__batching-disabled.md_test_0.snap b/tests/snapshots/execution_spec__batching-disabled.md_test_0.snap deleted file mode 100644 index c1db4d440d..0000000000 --- a/tests/snapshots/execution_spec__batching-disabled.md_test_0.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "u1": { - "id": 1 - }, - "u2": { - "id": 2 - } - } - } -} diff --git a/tests/snapshots/execution_spec__batching-group-by-default.md_client.snap b/tests/snapshots/execution_spec__batching-group-by-default.md_client.snap deleted file mode 100644 index f8e5c29910..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by-default.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching-group-by-default.md_merged.snap b/tests/snapshots/execution_spec__batching-group-by-default.md_merged.snap deleted file mode 100644 index e0746b8214..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by-default.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__batching-group-by-default.md_test_0.snap b/tests/snapshots/execution_spec__batching-group-by-default.md_test_0.snap deleted file mode 100644 index c95cface17..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by-default.md_test_0.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user": { - "id": 1 - }, - "userId": 1 - }, - { - "user": { - "id": 2 - }, - "userId": 2 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__batching-group-by.md_client.snap b/tests/snapshots/execution_spec__batching-group-by.md_client.snap deleted file mode 100644 index f8e5c29910..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching-group-by.md_merged.snap b/tests/snapshots/execution_spec__batching-group-by.md_merged.snap deleted file mode 100644 index a315e11c63..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}, {key: "foo", value: "bar"}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts?id=11&id=3&foo=1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__batching-group-by.md_test_0.snap b/tests/snapshots/execution_spec__batching-group-by.md_test_0.snap deleted file mode 100644 index c95cface17..0000000000 --- a/tests/snapshots/execution_spec__batching-group-by.md_test_0.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user": { - "id": 1 - }, - "userId": 1 - }, - { - "user": { - "id": 2 - }, - "userId": 2 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__batching-post.md_client.snap b/tests/snapshots/execution_spec__batching-post.md_client.snap deleted file mode 100644 index f8e5c29910..0000000000 --- a/tests/snapshots/execution_spec__batching-post.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching-post.md_merged.snap b/tests/snapshots/execution_spec__batching-post.md_merged.snap deleted file mode 100644 index 9233c413bd..0000000000 --- a/tests/snapshots/execution_spec__batching-post.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 1, headers: [], maxSize: 1000}, httpCache: true) { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(path: "/users/{{.value.userId}}") - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts?id=1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__batching-post.md_test_0.snap b/tests/snapshots/execution_spec__batching-post.md_test_0.snap deleted file mode 100644 index df16b720ba..0000000000 --- a/tests/snapshots/execution_spec__batching-post.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user": { - "name": "Leanne Graham" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__batching.md_client.snap b/tests/snapshots/execution_spec__batching.md_client.snap deleted file mode 100644 index 84d2907e22..0000000000 --- a/tests/snapshots/execution_spec__batching.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__batching.md_merged.snap b/tests/snapshots/execution_spec__batching.md_merged.snap deleted file mode 100644 index 7f4e597155..0000000000 --- a/tests/snapshots/execution_spec__batching.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(batchRequests: true) @upstream { - query: Query -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__batching.md_test_0.snap b/tests/snapshots/execution_spec__batching.md_test_0.snap deleted file mode 100644 index f4a82d3ebe..0000000000 --- a/tests/snapshots/execution_spec__batching.md_test_0.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": [ - { - "data": { - "user": { - "id": 1 - } - } - }, - { - "data": { - "user": { - "name": "foo" - } - } - } - ] -} diff --git a/tests/snapshots/execution_spec__batching.md_test_1.snap b/tests/snapshots/execution_spec__batching.md_test_1.snap deleted file mode 100644 index 5892866e24..0000000000 --- a/tests/snapshots/execution_spec__batching.md_test_1.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "id": 1 - } - } - } -} diff --git a/tests/snapshots/execution_spec__batching.md_test_2.snap b/tests/snapshots/execution_spec__batching.md_test_2.snap deleted file mode 100644 index 455e22a7d5..0000000000 --- a/tests/snapshots/execution_spec__batching.md_test_2.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": " --> 1:1\n |\n1 | FOO\n | ^---\n |\n = expected executable_definition", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__cache-control.md_client.snap b/tests/snapshots/execution_spec__cache-control.md_client.snap deleted file mode 100644 index 89319b393a..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__cache-control.md_merged.snap b/tests/snapshots/execution_spec__cache-control.md_merged.snap deleted file mode 100644 index 14b21d132d..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {cacheControl: true}) @upstream { - query: Query -} - -type Query { - user(id: Int): User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__cache-control.md_test_0.snap b/tests/snapshots/execution_spec__cache-control.md_test_0.snap deleted file mode 100644 index 7159134df4..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "cache-control": "max-age=3600", - "content-type": "application/json" - }, - "body": { - "data": { - "u1": { - "id": 1 - }, - "u2": { - "id": 2 - } - } - } -} diff --git a/tests/snapshots/execution_spec__cache-control.md_test_1.snap b/tests/snapshots/execution_spec__cache-control.md_test_1.snap deleted file mode 100644 index adae6faa84..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_test_1.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "cache-control": "max-age=3600, private", - "content-type": "application/json" - }, - "body": { - "data": { - "u1": { - "id": 1 - }, - "u3": { - "id": 3 - } - } - } -} diff --git a/tests/snapshots/execution_spec__cache-control.md_test_2.snap b/tests/snapshots/execution_spec__cache-control.md_test_2.snap deleted file mode 100644 index 08931aa49c..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_test_2.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "cache-control": "no-cache", - "content-type": "application/json" - }, - "body": { - "data": { - "u1": { - "id": 1 - }, - "u4": { - "id": 4 - } - } - } -} diff --git a/tests/snapshots/execution_spec__cache-control.md_test_3.snap b/tests/snapshots/execution_spec__cache-control.md_test_3.snap deleted file mode 100644 index fd928f7a26..0000000000 --- a/tests/snapshots/execution_spec__cache-control.md_test_3.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "cache-control": "no-cache, private", - "content-type": "application/json" - }, - "body": { - "data": { - "u3": { - "id": 3 - }, - "u4": { - "id": 4 - } - } - } -} diff --git a/tests/snapshots/execution_spec__caching-collision.md_client.snap b/tests/snapshots/execution_spec__caching-collision.md_client.snap deleted file mode 100644 index d22ceed81c..0000000000 --- a/tests/snapshots/execution_spec__caching-collision.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - foo: Foo - id: String! -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - id: Int! -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bars: [Bar] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__caching-collision.md_merged.snap b/tests/snapshots/execution_spec__caching-collision.md_merged.snap deleted file mode 100644 index 7f298ffb61..0000000000 --- a/tests/snapshots/execution_spec__caching-collision.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Bar { - foo: Foo @http(path: "/foo?id={{.value.id}}") @cache(maxAge: 300) - id: String! -} - -type Foo { - id: Int! -} - -type Query @cache(maxAge: 100) { - bars: [Bar] @http(path: "/bars") -} diff --git a/tests/snapshots/execution_spec__caching-collision.md_test_0.snap b/tests/snapshots/execution_spec__caching-collision.md_test_0.snap deleted file mode 100644 index 5aa7c651c5..0000000000 --- a/tests/snapshots/execution_spec__caching-collision.md_test_0.snap +++ /dev/null @@ -1,616 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "bars": [ - { - "foo": { - "id": 0 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBZh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 1 - }, - "id": "ByVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 2 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SE3mXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 3 - }, - "id": "BEVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 4 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DFPDXIwHe" - }, - { - "foo": { - "id": 5 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSoYIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 6 - }, - "id": "BVVLvrvaKTxZigeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 7 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEomXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 8 - }, - "id": "BVVLvrvaKFxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 9 - }, - "id": "BVVLvrvaKTxZdgeFvePbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 10 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jsz1qh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 11 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ5f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 12 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYftglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 13 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQ7YUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 14 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqp8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 15 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 16 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtHlFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 17 - }, - "id": "BVVLvrvaKTxZdgeFvbPbczXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 18 - }, - "id": "BVVLvrvaKTxZdgeF6bPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 19 - }, - "id": "BVVLvrvaKTxZdgeFGbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 20 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSxrIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 21 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSo9IxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 22 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjrXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 23 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FtO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 24 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3n2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 25 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FoO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 26 - }, - "id": "BVVLvVvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 27 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3VpzFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 28 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoumL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 29 - }, - "id": "BVVLvrvaKTYZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 30 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtgRFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 31 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sfZV2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 32 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwKe" - }, - { - "foo": { - "id": 33 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jjzyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 34 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmcWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 35 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFw4i4DNPDXIwHe" - }, - { - "foo": { - "id": 36 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL3345FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 37 - }, - "id": "BVVLvrvaKTxZdgaFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 38 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImR33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 39 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXRorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 40 - }, - "id": "BVVLvrvfKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 41 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQIf7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 42 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnOImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 43 - }, - "id": "BVVLvrvaKTxZdgeFvbPmckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 44 - }, - "id": "BVVLvrvaKTxZdgeFvbPbc9XSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 45 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3q7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 46 - }, - "id": "BVVLvrvaKTxZdgeFkbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 47 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoTmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 48 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIFmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 49 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33d5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 50 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSosIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 51 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SVjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 52 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4JszyJh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 53 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFhoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 54 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSSrIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 55 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Za6x1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 56 - }, - "id": "BVVLvrvaKTxZdgeFwbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 57 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SIjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 58 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImt33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 59 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoIwL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 60 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdw4DNPDXIwHe" - }, - { - "foo": { - "id": 61 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4J6zyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 62 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jskyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 63 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2NFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 64 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorFxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 65 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25yXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 66 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4lszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 67 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFmdi4DNPDXIwHe" - }, - { - "foo": { - "id": 68 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jsjyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 69 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sfXV2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 70 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYe25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 71 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSogIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 72 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33n5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 73 - }, - "id": "BVVLvrvaKTxZqgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 74 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwJi4DNPDXIwHe" - }, - { - "foo": { - "id": 75 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoKmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 76 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FY625TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 77 - }, - "id": "BVVLvrvaKTzZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 78 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoIFL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 79 - }, - "id": "BVVLvrvNKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 80 - }, - "id": "BVVLvrvaKTMZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 81 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFyoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 82 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3VqzFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 83 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4oszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 84 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDHIwHe" - }, - { - "foo": { - "id": 85 - }, - "id": "BVVLvrvaKvxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 86 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1yf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 87 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f8Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 88 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25rXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 89 - }, - "id": "BVVLvrvaKTxZdgPFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 90 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi45NPDXIwHe" - }, - { - "foo": { - "id": 91 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQHf7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 92 - }, - "id": "BVVLvrvaKTxZdgeFvbPb9kXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 93 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnonmL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 94 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUhkJszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 95 - }, - "id": "BVVLvrvFKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 96 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtglFnoImL33F5SYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 97 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Pszyqh8SEjmXWIQmYUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 98 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmYUtgHFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - }, - { - "foo": { - "id": 99 - }, - "id": "BVVLvrvaKTxZdgeFvbPbckXSorIxBUh4Jszyqh8SEjmXWIQmIUtglFnoImL33F5FYO25TXzQ3f7Zamx1sf3V2zFwdi4DNPDXIwHe" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__caching.md_client.snap b/tests/snapshots/execution_spec__caching.md_client.snap deleted file mode 100644 index 4184399572..0000000000 --- a/tests/snapshots/execution_spec__caching.md_client.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - fieldCache: Type - fieldCacheList: [Type] - typeCache: TypeCache -} - -type Type { - id: Int -} - -type TypeCache { - a: Type - b: Type - list: [Type] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__caching.md_merged.snap b/tests/snapshots/execution_spec__caching.md_merged.snap deleted file mode 100644 index 141c0ff2e2..0000000000 --- a/tests/snapshots/execution_spec__caching.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Query { - fieldCache: Type @http(path: "/field-cache") @cache(maxAge: 30000) - fieldCacheList: [Type] @http(path: "/field-cache-list") @cache(maxAge: 30000) - typeCache: TypeCache -} - -type Type { - id: Int -} - -type TypeCache @cache(maxAge: 1000) { - a: Type @http(path: "/type-cache-a") - b: Type @http(path: "/type-cache-b") - list: [Type] @http(path: "/type-cache-list") -} diff --git a/tests/snapshots/execution_spec__caching.md_test_0.snap b/tests/snapshots/execution_spec__caching.md_test_0.snap deleted file mode 100644 index e793e96b14..0000000000 --- a/tests/snapshots/execution_spec__caching.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "fieldCache": { - "id": 1 - } - } - } -} diff --git a/tests/snapshots/execution_spec__caching.md_test_1.snap b/tests/snapshots/execution_spec__caching.md_test_1.snap deleted file mode 100644 index c158551d3d..0000000000 --- a/tests/snapshots/execution_spec__caching.md_test_1.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "fieldCache": { - "id": 1 - }, - "fieldCacheList": [ - { - "id": 1 - }, - { - "id": 2 - }, - { - "id": 3 - } - ], - "typeCache": { - "a": { - "id": 11 - }, - "b": { - "id": 21 - }, - "list": [ - { - "id": 31 - }, - { - "id": 32 - }, - { - "id": 33 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__caching.md_test_2.snap b/tests/snapshots/execution_spec__caching.md_test_2.snap deleted file mode 100644 index c158551d3d..0000000000 --- a/tests/snapshots/execution_spec__caching.md_test_2.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "fieldCache": { - "id": 1 - }, - "fieldCacheList": [ - { - "id": 1 - }, - { - "id": 2 - }, - { - "id": 3 - } - ], - "typeCache": { - "a": { - "id": 11 - }, - "b": { - "id": 21 - }, - "list": [ - { - "id": 31 - }, - { - "id": 32 - }, - { - "id": 33 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-graphql-datasource.md_client.snap b/tests/snapshots/execution_spec__call-graphql-datasource.md_client.snap deleted file mode 100644 index 284c9f66fb..0000000000 --- a/tests/snapshots/execution_spec__call-graphql-datasource.md_client.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String! - id: Int! - title: String! - user(id: Int): User - userId: Int! -} - -type Query { - posts: [Post] - user(id: Int!): User -} - -scalar Url - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__call-graphql-datasource.md_merged.snap b/tests/snapshots/execution_spec__call-graphql-datasource.md_merged.snap deleted file mode 100644 index 691c98df60..0000000000 --- a/tests/snapshots/execution_spec__call-graphql-datasource.md_merged.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { - query: Query -} - -type Post { - body: String! - id: Int! - title: String! - user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts") - user(id: Int!): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") -} - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} diff --git a/tests/snapshots/execution_spec__call-graphql-datasource.md_test_0.snap b/tests/snapshots/execution_spec__call-graphql-datasource.md_test_0.snap deleted file mode 100644 index a225bd7fb9..0000000000 --- a/tests/snapshots/execution_spec__call-graphql-datasource.md_test_0.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "title": "a", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "b", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "c", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "d", - "user": { - "name": "Ervin Howell" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_client.snap b/tests/snapshots/execution_spec__call-multiple-steps-piping.md_client.snap deleted file mode 100644 index 1d35d1781c..0000000000 --- a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_client.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - a(input: JSON): JSON - a_input(input: JSON): JSON - abc(input: JSON): JSON - abc_input(input: JSON): JSON - b(input: JSON): JSON - b_input(input: JSON): JSON - c(input: JSON): JSON - wrap_args: JSON - wrap_input(input: JSON): JSON -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_merged.snap b/tests/snapshots/execution_spec__call-multiple-steps-piping.md_merged.snap deleted file mode 100644 index bef1dfcb25..0000000000 --- a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_merged.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - a(input: JSON): JSON @expr(body: "{{.args.input.a}}") - a_input(input: JSON): JSON @expr(body: {input: "{{.args.input.a}}"}) - abc(input: JSON): JSON @call(steps: [{query: "a", args: {input: "{{.args.input}}"}}, {query: "wrap_args"}, {query: "b"}, {query: "wrap_args"}, {query: "c"}]) - abc_input(input: JSON): JSON @call(steps: [{query: "wrap_input", args: {input: "{{.args.input}}"}}, {query: "a_input"}, {query: "wrap_input"}, {query: "b_input"}, {query: "wrap_input"}, {query: "c"}]) - b(input: JSON): JSON @expr(body: "{{.args.input.b}}") - b_input(input: JSON): JSON @expr(body: {input: "{{.args.input.b}}"}) - c(input: JSON): JSON @expr(body: "{{.args.input.c}}") - wrap_args: JSON @expr(body: {input: "{{.args}}"}) - wrap_input(input: JSON): JSON @expr(body: {input: "{{.args.input}}"}) -} diff --git a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_0.snap b/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_0.snap deleted file mode 100644 index 3303eba69f..0000000000 --- a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "abc_input": 3 - } - } -} diff --git a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_1.snap b/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_1.snap deleted file mode 100644 index 5796f20b8a..0000000000 --- a/tests/snapshots/execution_spec__call-multiple-steps-piping.md_test_1.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "abc": 3 - } - } -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_client.snap b/tests/snapshots/execution_spec__call-mutation.md_client.snap deleted file mode 100644 index fc2aa7d84a..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_client.snap +++ /dev/null @@ -1,59 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - attachPostToFirstUser(postId: Int, userId: Int): User - attachPostToUser(postId: Int!, userId: Int!): User - insertMockedPost(input: PostInput): Post - insertPost(input: PostInput): Post - insertPostToFirstUser(input: PostInputWithoutUserId, userId: Int): Post - insertPostToUser(input: PostInputWithoutUserId!, userId: Int!): Post -} - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int -} - -input PostInput { - body: String - title: String - userId: Int -} - -input PostInputWithoutUserId { - body: String - title: String - userId: Int -} - -type Query { - firstUser: User - postFromUser(userId: Int!): Post -} - -scalar Url - -type User { - id: Int - name: String - posts(userId: Int): [Post] -} - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_merged.snap b/tests/snapshots/execution_spec__call-mutation.md_merged.snap deleted file mode 100644 index 8f65b57362..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_merged.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query - mutation: Mutation -} - -input PostInput { - body: String - title: String - userId: Int -} - -input PostInputWithoutUserId { - body: String - title: String - userId: Int -} - -type Mutation { - attachPostToFirstUser(postId: Int!): User @call(steps: [{mutation: "attachPostToUser", args: {postId: "{{.args.postId}}", userId: 1}}]) - attachPostToUser(postId: Int!, userId: Int!): User @http(body: "{\"postId\":{{.args.postId}}}", method: "PATCH", path: "/users/{{.args.userId}}") - insertMockedPost: Post @call(steps: [{mutation: "insertPost", args: {input: {body: "post-body", title: "post-title", userId: 1}}}]) - insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") - insertPostToFirstUser(input: PostInputWithoutUserId): Post @call(steps: [{mutation: "insertPostToUser", args: {input: "{{.args.input}}", userId: 1}}]) - insertPostToUser(input: PostInputWithoutUserId!, userId: Int!): Post @http(body: "{{.args.input}}", method: "POST", path: "/users/{{.args.userId}}/posts") -} - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Query { - firstUser: User @http(path: "/users/1") - postFromUser(userId: Int!): Post @http(path: "/posts?userId={{.args.userId}}") -} - -type User { - id: Int - name: String - posts: [Post] @call(steps: [{query: "postFromUser", args: {userId: "{{.value.id}}"}}]) -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_test_0.snap b/tests/snapshots/execution_spec__call-mutation.md_test_0.snap deleted file mode 100644 index 3d78c855be..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "insertPost": { - "body": "post-body" - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_test_1.snap b/tests/snapshots/execution_spec__call-mutation.md_test_1.snap deleted file mode 100644 index 3a76bb8893..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_test_1.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "posts": [ - { - "title": "post1-title" - }, - { - "title": "post2-title" - }, - { - "title": "post3-title" - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_test_2.snap b/tests/snapshots/execution_spec__call-mutation.md_test_2.snap deleted file mode 100644 index d4f83b0a6c..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_test_2.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "attachPostToFirstUser": { - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_test_3.snap b/tests/snapshots/execution_spec__call-mutation.md_test_3.snap deleted file mode 100644 index 835e659056..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_test_3.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "insertPostToFirstUser": { - "body": "post-body" - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-mutation.md_test_4.snap b/tests/snapshots/execution_spec__call-mutation.md_test_4.snap deleted file mode 100644 index 7ca89a4e51..0000000000 --- a/tests/snapshots/execution_spec__call-mutation.md_test_4.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "insertMockedPost": { - "body": "post-body" - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_client.snap b/tests/snapshots/execution_spec__call-operator.md_client.snap deleted file mode 100644 index 013632b707..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_client.snap +++ /dev/null @@ -1,77 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -scalar PhoneNumber - -type Post { - body: String - id: Int - news: NewsData! - newsWithPortArg: NewsData! - title: String - user(id: Int): User - user1: User - userFromValue: User - userGraphQL(id: Int): User - userGraphQLHeaders(id: Int): User - userHttpHeaders(id: ID): User - userHttpQuery(id: ID): User - userId: Int! -} - -type Query { - news: NewsData! - newsWithPortArg(port: Int!): NewsData! - posts: [Post] - user(id: Int!): User - user1: User - userFromValue: User - userGraphQL(id: Int): User - userGraphQLHeaders(id: Int!): User - userHttpHeaders(id: ID!): User - userHttpQuery(id: ID!): User - userId: Int! - userPosts(id: ID!): [Post] - userWithPosts: UserWithPosts -} - -scalar Url - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} - -type UserWithPosts { - id: Int! - name: String! - posts(id: ID): [Post] -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__call-operator.md_merged.snap b/tests/snapshots/execution_spec__call-operator.md_merged.snap deleted file mode 100644 index 1308ff5d7b..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_merged.snap +++ /dev/null @@ -1,65 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Post { - body: String - id: Int - news: NewsData! @call(steps: [{query: "news"}]) - newsWithPortArg: NewsData! @call(steps: [{query: "news", args: {port: 50051}}]) - title: String - user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) - user1: User @call(steps: [{query: "user1"}]) - userFromValue: User @call(steps: [{query: "userFromValue"}]) - userGraphQL: User @call(steps: [{query: "userGraphQL", args: {id: "{{.value.userId}}"}}]) - userGraphQLHeaders: User @call(steps: [{query: "userGraphQLHeaders", args: {id: "{{.value.userId}}"}}]) - userHttpHeaders: User @call(steps: [{query: "userHttpHeaders", args: {id: "{{.value.userId}}"}}]) - userHttpQuery: User @call(steps: [{query: "userHttpQuery", args: {id: "{{.value.userId}}"}}]) - userId: Int! -} - -type Query { - news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") - newsWithPortArg(port: Int!): NewsData! @grpc(baseURL: "http://localhost:{{.args.port}}", method: "news.NewsService.GetAllNews") - posts: [Post] @http(path: "/posts") - user(id: Int!): User @http(path: "/users/{{.args.id}}") - user1: User @http(path: "/users/1") - userFromValue: User @http(path: "/users/{{.value.userId}}") - userGraphQL(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") - userGraphQLHeaders(id: Int!): User @graphQL(baseURL: "http://upstream/graphql", headers: [{key: "id", value: "{{.args.id}}"}], name: "user") - userHttpHeaders(id: ID!): User @http(headers: [{key: "id", value: "{{.args.id}}"}], path: "/users") - userHttpQuery(id: ID!): User @http(path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) - userId: Int! @expr(body: 2) - userPosts(id: ID!): [Post] @http(path: "/posts", query: [{key: "userId", value: "{{.args.id}}"}]) - userWithPosts: UserWithPosts @http(path: "/users/1") -} - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} - -type UserWithPosts { - id: Int! - name: String! - posts: [Post] @call(steps: [{query: "userPosts", args: {id: "{{.value.id}}"}}]) -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_0.snap b/tests/snapshots/execution_spec__call-operator.md_test_0.snap deleted file mode 100644 index 1c66149129..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user": { - "name": "foo" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_1.snap b/tests/snapshots/execution_spec__call-operator.md_test_1.snap deleted file mode 100644 index cc3001b654..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_1.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "user1": { - "name": "foo" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_10.snap b/tests/snapshots/execution_spec__call-operator.md_test_10.snap deleted file mode 100644 index e5000b46b8..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_10.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "news": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_11.snap b/tests/snapshots/execution_spec__call-operator.md_test_11.snap deleted file mode 100644 index 4e597f1483..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_11.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "newsWithPortArg": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_12.snap b/tests/snapshots/execution_spec__call-operator.md_test_12.snap deleted file mode 100644 index 4efab928b1..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_12.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "newsWithPortArg": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_2.snap b/tests/snapshots/execution_spec__call-operator.md_test_2.snap deleted file mode 100644 index 1847d21126..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_2.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "userFromValue": { - "name": "foo" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_3.snap b/tests/snapshots/execution_spec__call-operator.md_test_3.snap deleted file mode 100644 index a3d0e94825..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_3.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "userGraphQLHeaders": { - "name": "Leanne Graham" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_4.snap b/tests/snapshots/execution_spec__call-operator.md_test_4.snap deleted file mode 100644 index a3d0e94825..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_4.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "userGraphQLHeaders": { - "name": "Leanne Graham" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_5.snap b/tests/snapshots/execution_spec__call-operator.md_test_5.snap deleted file mode 100644 index 7ab7c5fe98..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_5.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "userHttpHeaders": { - "name": "Leanne Graham http headers" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_6.snap b/tests/snapshots/execution_spec__call-operator.md_test_6.snap deleted file mode 100644 index b5d6ba9f8b..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_6.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "userHttpQuery": { - "name": "Leanne Graham http query" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_7.snap b/tests/snapshots/execution_spec__call-operator.md_test_7.snap deleted file mode 100644 index fb0e7a0ddc..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_7.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "userPosts": [ - { - "title": "bar" - }, - { - "title": "qux" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_8.snap b/tests/snapshots/execution_spec__call-operator.md_test_8.snap deleted file mode 100644 index 2da02e70d2..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_8.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "userWithPosts": { - "posts": [ - { - "title": "bar" - }, - { - "title": "qux" - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__call-operator.md_test_9.snap b/tests/snapshots/execution_spec__call-operator.md_test_9.snap deleted file mode 100644 index 93c8d4001e..0000000000 --- a/tests/snapshots/execution_spec__call-operator.md_test_9.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "news": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-false.md_client.snap b/tests/snapshots/execution_spec__cors-allow-cred-false.md_client.snap deleted file mode 100644 index 48b4b87db4..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-false.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - val: Int -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-false.md_merged.snap b/tests/snapshots/execution_spec__cors-allow-cred-false.md_merged.snap deleted file mode 100644 index 9e105b4f23..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-false.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {cors: {allowHeaders: ["Authorization"], allowMethods: ["POST", "OPTIONS"], allowOrigins: ["abc.com", "xyz.com"], allowPrivateNetwork: true, maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Query { - val: Int @expr(body: 1) -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-false.md_test_0.snap b/tests/snapshots/execution_spec__cors-allow-cred-false.md_test_0.snap deleted file mode 100644 index e08057de7f..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-false.md_test_0.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "access-control-allow-headers": "Authorization", - "access-control-allow-methods": "POST, OPTIONS", - "access-control-max-age": "23", - "vary": "origin, access-control-request-method, access-control-request-headers" - }, - "body": null -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-true.md_client.snap b/tests/snapshots/execution_spec__cors-allow-cred-true.md_client.snap deleted file mode 100644 index 48b4b87db4..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-true.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - val: Int -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-true.md_merged.snap b/tests/snapshots/execution_spec__cors-allow-cred-true.md_merged.snap deleted file mode 100644 index eaeef0f412..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-true.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {cors: {allowCredentials: true, allowMethods: ["OPTIONS", "POST", "GET"], allowOrigins: ["abc.com", "xyz.com"], exposeHeaders: [""], maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Query { - val: Int @expr(body: 1) -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-true.md_test_0.snap b/tests/snapshots/execution_spec__cors-allow-cred-true.md_test_0.snap deleted file mode 100644 index 459b7941a2..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-true.md_test_0.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "access-control-allow-credentials": "true", - "access-control-allow-methods": "OPTIONS, POST, GET", - "access-control-max-age": "23", - "vary": "origin, access-control-request-method, access-control-request-headers" - }, - "body": null -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_client.snap b/tests/snapshots/execution_spec__cors-allow-cred-vary.md_client.snap deleted file mode 100644 index 48b4b87db4..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - val: Int -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_merged.snap b/tests/snapshots/execution_spec__cors-allow-cred-vary.md_merged.snap deleted file mode 100644 index eaeef0f412..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {cors: {allowCredentials: true, allowMethods: ["OPTIONS", "POST", "GET"], allowOrigins: ["abc.com", "xyz.com"], exposeHeaders: [""], maxAge: 23, vary: ["origin", "access-control-request-method", "access-control-request-headers"]}}) @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Query { - val: Int @expr(body: 1) -} diff --git a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_test_0.snap b/tests/snapshots/execution_spec__cors-allow-cred-vary.md_test_0.snap deleted file mode 100644 index e20d306310..0000000000 --- a/tests/snapshots/execution_spec__cors-allow-cred-vary.md_test_0.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "access-control-allow-credentials": "true", - "access-control-expose-headers": "", - "content-type": "application/json", - "vary": "origin, access-control-request-method, access-control-request-headers" - }, - "body": { - "data": { - "val": 1 - } - } -} diff --git a/tests/snapshots/execution_spec__custom-headers.md_client.snap b/tests/snapshots/execution_spec__custom-headers.md_client.snap deleted file mode 100644 index 14b224be11..0000000000 --- a/tests/snapshots/execution_spec__custom-headers.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - greet: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__custom-headers.md_merged.snap b/tests/snapshots/execution_spec__custom-headers.md_merged.snap deleted file mode 100644 index 747626e649..0000000000 --- a/tests/snapshots/execution_spec__custom-headers.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {custom: [{key: "x-id", value: "1"}, {key: "x-name", value: "John Doe"}]}) @upstream { - query: Query -} - -type Query { - greet: String @expr(body: "Hello World!") -} diff --git a/tests/snapshots/execution_spec__custom-headers.md_test_0.snap b/tests/snapshots/execution_spec__custom-headers.md_test_0.snap deleted file mode 100644 index 235aef02a4..0000000000 --- a/tests/snapshots/execution_spec__custom-headers.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json", - "x-id": "1", - "x-name": "John Doe" - }, - "body": { - "data": { - "greet": "Hello World!" - } - } -} diff --git a/tests/snapshots/execution_spec__env-value.md_client.snap b/tests/snapshots/execution_spec__env-value.md_client.snap deleted file mode 100644 index d35d947756..0000000000 --- a/tests/snapshots/execution_spec__env-value.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int! -} - -type Query { - post1: Post - post2: Post - post3: Post -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__env-value.md_merged.snap b/tests/snapshots/execution_spec__env-value.md_merged.snap deleted file mode 100644 index 2d23ab3ce3..0000000000 --- a/tests/snapshots/execution_spec__env-value.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Post { - body: String - id: Int - title: String - userId: Int! -} - -type Query { - post1: Post @http(path: "/posts/{{.env.ID}}") - post2: Post @http(path: "/posts/{{.env.POST_ID}}") - post3: Post @http(path: "/posts/{{.env.NESTED_POST_ID}}") -} diff --git a/tests/snapshots/execution_spec__env-value.md_test_0.snap b/tests/snapshots/execution_spec__env-value.md_test_0.snap deleted file mode 100644 index b232cce8f1..0000000000 --- a/tests/snapshots/execution_spec__env-value.md_test_0.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "post1": { - "id": 1, - "title": "Post 1", - "body": "Post 1 body", - "userId": 1 - }, - "post2": { - "id": 2, - "title": "Post 2", - "body": "Post 2 body", - "userId": 2 - }, - "post3": { - "id": 3, - "title": "Post 3", - "body": "Post 3 body", - "userId": 3 - } - } - } -} diff --git a/tests/snapshots/execution_spec__experimental-headers.md_client.snap b/tests/snapshots/execution_spec__experimental-headers.md_client.snap deleted file mode 100644 index 42fce3979b..0000000000 --- a/tests/snapshots/execution_spec__experimental-headers.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - users: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__experimental-headers.md_merged.snap b/tests/snapshots/execution_spec__experimental-headers.md_merged.snap deleted file mode 100644 index 60411da506..0000000000 --- a/tests/snapshots/execution_spec__experimental-headers.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {experimental: ["X-experimental", "x-tailcall"]}) @upstream { - query: Query -} - -type Query { - users: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__experimental-headers.md_test_0.snap b/tests/snapshots/execution_spec__experimental-headers.md_test_0.snap deleted file mode 100644 index 768f30d2d9..0000000000 --- a/tests/snapshots/execution_spec__experimental-headers.md_test_0.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json", - "x-experimental": "experimental-header", - "x-tailcall": "tailcall-header" - }, - "body": { - "data": { - "users": [ - { - "id": 1, - "name": "Leanne Graham" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_client.snap b/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_client.snap deleted file mode 100644 index 8e25456c09..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_client.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int - title: String - user: User - userId: Int -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_merged.snap b/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_merged.snap deleted file mode 100644 index 47f1d039d4..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(batch: {delay: 1, headers: []}) { - query: Query -} - -type Post { - id: Int - title: String - user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], baseURL: "http://upstream/graphql", batch: true, name: "user") - userId: Int -} - -type Query { - posts: [Post] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_test_0.snap b/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_test_0.snap deleted file mode 100644 index a225bd7fb9..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-batch-request.md_test_0.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "title": "a", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "b", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "c", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "d", - "user": { - "name": "Ervin Howell" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_client.snap b/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_client.snap deleted file mode 100644 index 8e25456c09..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_client.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int - title: String - user: User - userId: Int -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_merged.snap b/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_merged.snap deleted file mode 100644 index 51de60d0a5..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(batch: {delay: 1, headers: []}) { - query: Query -} - -type Post { - id: Int - title: String - user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], baseURL: "http://upstream/graphql", name: "user") - userId: Int -} - -type Query { - posts: [Post] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_test_0.snap b/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_test_0.snap deleted file mode 100644 index a225bd7fb9..0000000000 --- a/tests/snapshots/execution_spec__graphql-dataloader-no-batch-request.md_test_0.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "title": "a", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "b", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "c", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "d", - "user": { - "name": "Ervin Howell" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-errors.md_client.snap b/tests/snapshots/execution_spec__graphql-datasource-errors.md_client.snap deleted file mode 100644 index 89319b393a..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-errors.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-errors.md_merged.snap b/tests/snapshots/execution_spec__graphql-datasource-errors.md_merged.snap deleted file mode 100644 index 466f43fe72..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-errors.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - user(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap b/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap deleted file mode 100644 index e68bb4b23a..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_0.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": null - }, - "errors": [ - { - "message": "Failed to resolve user", - "locations": [ - { - "line": 1, - "column": 9 - } - ], - "path": [ - "user" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_1.snap b/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_1.snap deleted file mode 100644 index d983fdbd76..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-errors.md_test_1.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": null, - "id": 2 - } - }, - "errors": [ - { - "message": "Failed to resolve name", - "locations": [ - { - "line": 1, - "column": 35 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_client.snap b/tests/snapshots/execution_spec__graphql-datasource-mutation.md_client.snap deleted file mode 100644 index 3845056745..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_client.snap +++ /dev/null @@ -1,39 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - createUser(user: UserInput!): User -} - -scalar PhoneNumber - -type Query { - users: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -input UserInput { - email: String! - name: String! - phone: String -} - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_merged.snap b/tests/snapshots/execution_spec__graphql-datasource-mutation.md_merged.snap deleted file mode 100644 index fff4739cac..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_merged.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query - mutation: Mutation -} - -input UserInput { - email: String! - name: String! - phone: String -} - -type Mutation { - createUser(user: UserInput!): User @graphQL(args: [{key: "user", value: "{{.args.user}}"}], baseURL: "http://upstream/graphql", name: "createUser") -} - -type Query { - users: [User] @graphQL(baseURL: "http://upstream/graphql", name: "users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_test_0.snap b/tests/snapshots/execution_spec__graphql-datasource-mutation.md_test_0.snap deleted file mode 100644 index 97ad7a4f99..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-mutation.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "createUser": { - "name": "Test Name" - } - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_client.snap b/tests/snapshots/execution_spec__graphql-datasource-no-args.md_client.snap deleted file mode 100644 index 98911cf9c6..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - users_list: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_merged.snap b/tests/snapshots/execution_spec__graphql-datasource-no-args.md_merged.snap deleted file mode 100644 index bc23a3c9fb..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - users_list: [User] @graphQL(baseURL: "http://upstream/graphql", name: "users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_test_0.snap b/tests/snapshots/execution_spec__graphql-datasource-no-args.md_test_0.snap deleted file mode 100644 index 91f1cbd53b..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-no-args.md_test_0.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "users_list": [ - { - "name": "Leanne Graham" - }, - { - "name": "Ervin Howell" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_client.snap b/tests/snapshots/execution_spec__graphql-datasource-with-args.md_client.snap deleted file mode 100644 index 06aac8d40c..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_client.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int - user: User -} - -type Query { - post(id: Int): Post - user(id: Int): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_merged.snap b/tests/snapshots/execution_spec__graphql-datasource-with-args.md_merged.snap deleted file mode 100644 index f0617c3429..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Post { - id: Int - user: User -} - -type Query { - post(id: Int): Post @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "post") - user(id: Int): User @graphQL(args: [{key: "id", value: "{{.args.id}}"}], baseURL: "http://upstream/graphql", name: "user") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_0.snap b/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_0.snap deleted file mode 100644 index b438022b0f..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "Leanne Graham" - } - } - } -} diff --git a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_1.snap b/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_1.snap deleted file mode 100644 index 519a90479e..0000000000 --- a/tests/snapshots/execution_spec__graphql-datasource-with-args.md_test_1.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "post": { - "id": 1, - "user": { - "name": "Leanne Graham" - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__grpc-batch.md_client.snap b/tests/snapshots/execution_spec__grpc-batch.md_client.snap deleted file mode 100644 index 5d27fe0949..0000000000 --- a/tests/snapshots/execution_spec__grpc-batch.md_client.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-batch.md_merged.snap b/tests/snapshots/execution_spec__grpc-batch.md_merged.snap deleted file mode 100644 index e2ce486579..0000000000 --- a/tests/snapshots/execution_spec__grpc-batch.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", batchKey: ["news", "id"], method: "news.NewsService.GetMultipleNews") -} diff --git a/tests/snapshots/execution_spec__grpc-batch.md_test_0.snap b/tests/snapshots/execution_spec__grpc-batch.md_test_0.snap deleted file mode 100644 index eff3d79f5a..0000000000 --- a/tests/snapshots/execution_spec__grpc-batch.md_test_0.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "newsById2": { - "title": "Note 2" - }, - "newsById3": { - "title": "Note 3" - } - } - } -} diff --git a/tests/snapshots/execution_spec__grpc-error.md_client.snap b/tests/snapshots/execution_spec__grpc-error.md_client.snap deleted file mode 100644 index 5d27fe0949..0000000000 --- a/tests/snapshots/execution_spec__grpc-error.md_client.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-error.md_merged.snap b/tests/snapshots/execution_spec__grpc-error.md_merged.snap deleted file mode 100644 index 9e1de964db..0000000000 --- a/tests/snapshots/execution_spec__grpc-error.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") -} diff --git a/tests/snapshots/execution_spec__grpc-error.md_test_0.snap b/tests/snapshots/execution_spec__grpc-error.md_test_0.snap deleted file mode 100644 index 089e1439d2..0000000000 --- a/tests/snapshots/execution_spec__grpc-error.md_test_0.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "gRPC Error: status: 3, description: `Client specified an invalid argument`, message: `grpc message`", - "locations": [ - { - "line": 1, - "column": 9 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_client.snap b/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_client.snap deleted file mode 100644 index 5d27fe0949..0000000000 --- a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_client.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_merged.snap b/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_merged.snap deleted file mode 100644 index 6daa62a280..0000000000 --- a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://not-a-valid-grpc-url.com", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") -} diff --git a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_test_0.snap b/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_test_0.snap deleted file mode 100644 index 93c8d4001e..0000000000 --- a/tests/snapshots/execution_spec__grpc-override-url-from-upstream.md_test_0.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "news": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_client.snap b/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_client.snap deleted file mode 100644 index a909f59e7d..0000000000 --- a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - bar: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - foo: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bar: Bar! - foo: Foo! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_merged.snap b/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_merged.snap deleted file mode 100644 index f35c9b06e8..0000000000 --- a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051") @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { - query: Query -} - -type Bar { - bar: String -} - -type Foo { - foo: String -} - -type Query { - bar: Bar! @grpc(method: "test.BarService.GetBar") - foo: Foo! @grpc(method: "test.FooService.GetFoo") -} diff --git a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_test_0.snap b/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_test_0.snap deleted file mode 100644 index 9b046b6ceb..0000000000 --- a/tests/snapshots/execution_spec__grpc-proto-with-same-package.md_test_0.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "foo": { - "foo": "test-foo" - }, - "bar": { - "bar": "test-bar" - } - } - } -} diff --git a/tests/snapshots/execution_spec__grpc-simple.md_client.snap b/tests/snapshots/execution_spec__grpc-simple.md_client.snap deleted file mode 100644 index 5d27fe0949..0000000000 --- a/tests/snapshots/execution_spec__grpc-simple.md_client.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-simple.md_merged.snap b/tests/snapshots/execution_spec__grpc-simple.md_merged.snap deleted file mode 100644 index 9e1de964db..0000000000 --- a/tests/snapshots/execution_spec__grpc-simple.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(baseURL: "http://localhost:50051", method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(baseURL: "http://localhost:50051", body: "{{.args.news}}", method: "news.NewsService.GetNews") -} diff --git a/tests/snapshots/execution_spec__grpc-simple.md_test_0.snap b/tests/snapshots/execution_spec__grpc-simple.md_test_0.snap deleted file mode 100644 index 93c8d4001e..0000000000 --- a/tests/snapshots/execution_spec__grpc-simple.md_test_0.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "news": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_client.snap b/tests/snapshots/execution_spec__grpc-url-from-upstream.md_client.snap deleted file mode 100644 index 5d27fe0949..0000000000 --- a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_client.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_merged.snap b/tests/snapshots/execution_spec__grpc-url-from-upstream.md_merged.snap deleted file mode 100644 index c2dcaef997..0000000000 --- a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") -} diff --git a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_test_0.snap b/tests/snapshots/execution_spec__grpc-url-from-upstream.md_test_0.snap deleted file mode 100644 index 93c8d4001e..0000000000 --- a/tests/snapshots/execution_spec__grpc-url-from-upstream.md_test_0.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "news": { - "news": [ - { - "id": 1 - }, - { - "id": 2 - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__https.md_client.snap b/tests/snapshots/execution_spec__https.md_client.snap deleted file mode 100644 index 2ae445a996..0000000000 --- a/tests/snapshots/execution_spec__https.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__https.md_merged.snap b/tests/snapshots/execution_spec__https.md_merged.snap deleted file mode 100644 index cec4e53890..0000000000 --- a/tests/snapshots/execution_spec__https.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - firstUser: User @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__https.md_test_0.snap b/tests/snapshots/execution_spec__https.md_test_0.snap deleted file mode 100644 index 0204fa30dc..0000000000 --- a/tests/snapshots/execution_spec__https.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "name": "Leanne Graham" - } - } - } -} diff --git a/tests/snapshots/execution_spec__inline-field.md_client.snap b/tests/snapshots/execution_spec__inline-field.md_client.snap deleted file mode 100644 index e0ba3147d9..0000000000 --- a/tests/snapshots/execution_spec__inline-field.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__inline-field.md_merged.snap b/tests/snapshots/execution_spec__inline-field.md_merged.snap deleted file mode 100644 index a4b6f89a4e..0000000000 --- a/tests/snapshots/execution_spec__inline-field.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - geo: Geo -} - -type Geo { - lat: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "address", path: ["address", "geo", "lat"]) { - address: Address @modify(omit: true) -} diff --git a/tests/snapshots/execution_spec__inline-field.md_test_0.snap b/tests/snapshots/execution_spec__inline-field.md_test_0.snap deleted file mode 100644 index d6c346a175..0000000000 --- a/tests/snapshots/execution_spec__inline-field.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "address": "-37.3159" - } - } - } -} diff --git a/tests/snapshots/execution_spec__inline-index-list.md_client.snap b/tests/snapshots/execution_spec__inline-index-list.md_client.snap deleted file mode 100644 index f36f868741..0000000000 --- a/tests/snapshots/execution_spec__inline-index-list.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - username: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__inline-index-list.md_merged.snap b/tests/snapshots/execution_spec__inline-index-list.md_merged.snap deleted file mode 100644 index 7191b8d138..0000000000 --- a/tests/snapshots/execution_spec__inline-index-list.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query @addField(name: "username", path: ["username", "0", "name"]) { - username: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") @modify(omit: true) -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__inline-index-list.md_test_0.snap b/tests/snapshots/execution_spec__inline-index-list.md_test_0.snap deleted file mode 100644 index 29d33382cd..0000000000 --- a/tests/snapshots/execution_spec__inline-index-list.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "username": "Leanne Graham" - } - } -} diff --git a/tests/snapshots/execution_spec__inline-many-list.md_client.snap b/tests/snapshots/execution_spec__inline-many-list.md_client.snap deleted file mode 100644 index 64b314c987..0000000000 --- a/tests/snapshots/execution_spec__inline-many-list.md_client.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - u: U -} - -type U { - b: [String] - c: String - d: String - e: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__inline-many-list.md_merged.snap b/tests/snapshots/execution_spec__inline-many-list.md_merged.snap deleted file mode 100644 index 54bba824b0..0000000000 --- a/tests/snapshots/execution_spec__inline-many-list.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type A { - b: [String] - c: String - d: String -} - -type Query { - u: U @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/us/1") -} - -type U @addField(name: "b", path: ["a", "b"]) @addField(name: "c", path: ["a", "c"]) @addField(name: "d", path: ["a", "d"]) { - a: A @modify(omit: true) - e: String -} diff --git a/tests/snapshots/execution_spec__inline-many.md_client.snap b/tests/snapshots/execution_spec__inline-many.md_client.snap deleted file mode 100644 index 9ea4260639..0000000000 --- a/tests/snapshots/execution_spec__inline-many.md_client.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - city: String - name: String - street: String - zipcode: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__inline-many.md_merged.snap b/tests/snapshots/execution_spec__inline-many.md_merged.snap deleted file mode 100644 index 43058f4640..0000000000 --- a/tests/snapshots/execution_spec__inline-many.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - city: String - street: String - zipcode: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "city", path: ["address", "city"]) @addField(name: "street", path: ["address", "street"]) @addField(name: "zipcode", path: ["address", "zipcode"]) { - address: Address @modify(omit: true) - name: String -} diff --git a/tests/snapshots/execution_spec__io-cache.md_client.snap b/tests/snapshots/execution_spec__io-cache.md_client.snap deleted file mode 100644 index 5572c8f8f5..0000000000 --- a/tests/snapshots/execution_spec__io-cache.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String! - id: Int! - title: String! - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__io-cache.md_merged.snap b/tests/snapshots/execution_spec__io-cache.md_merged.snap deleted file mode 100644 index 6929ce8a9d..0000000000 --- a/tests/snapshots/execution_spec__io-cache.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { - query: Query -} - -type Post { - body: String! - id: Int! - title: String! - user: User @http(path: "/users/{{.value.userId}}") - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts") -} - -type User { - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__io-cache.md_test_0.snap b/tests/snapshots/execution_spec__io-cache.md_test_0.snap deleted file mode 100644 index de60e84792..0000000000 --- a/tests/snapshots/execution_spec__io-cache.md_test_0.snap +++ /dev/null @@ -1,52 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "title": "a", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "b", - "user": { - "name": "Leanne Graham" - } - }, - { - "title": "c", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "d", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "e", - "user": { - "name": "Ervin Howell" - } - }, - { - "title": "f", - "user": { - "name": "Ervin Howell" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_client.snap b/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_client.snap deleted file mode 100644 index 71337782f0..0000000000 --- a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int! - title: String! - user(id: Int): User - userId: Int! -} - -type Query { - posts: [Post] - user(id: Int!): User - users: [User] -} - -scalar Url - -type User { - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_merged.snap b/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_merged.snap deleted file mode 100644 index a063169729..0000000000 --- a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_merged.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 100, headers: []}, httpCache: true) { - query: Query -} - -type Post { - id: Int! - title: String! - user: User @call(steps: [{query: "user", args: {id: "{{.value.userId}}"}}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts") - user(id: Int!): User @http(path: "/users/{{.args.id}}") - users: [User] @http(path: "/users") -} - -type User { - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_test_0.snap b/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_test_0.snap deleted file mode 100644 index 6d55adcbc2..0000000000 --- a/tests/snapshots/execution_spec__jsonplaceholder-call-post.md_test_0.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "title": "title1", - "user": { - "name": "Leanne Graham" - } - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__modified-field.md_client.snap b/tests/snapshots/execution_spec__modified-field.md_client.snap deleted file mode 100644 index 44d5e21293..0000000000 --- a/tests/snapshots/execution_spec__modified-field.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - fullname: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__modified-field.md_merged.snap b/tests/snapshots/execution_spec__modified-field.md_merged.snap deleted file mode 100644 index 0398a0e420..0000000000 --- a/tests/snapshots/execution_spec__modified-field.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - name: String @modify(name: "fullname") -} diff --git a/tests/snapshots/execution_spec__modified-field.md_test_0.snap b/tests/snapshots/execution_spec__modified-field.md_test_0.snap deleted file mode 100644 index d5de6f93fe..0000000000 --- a/tests/snapshots/execution_spec__modified-field.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "fullname": "Leanne Graham" - } - } - } -} diff --git a/tests/snapshots/execution_spec__mutation-put.md_client.snap b/tests/snapshots/execution_spec__mutation-put.md_client.snap deleted file mode 100644 index 0578daf7b9..0000000000 --- a/tests/snapshots/execution_spec__mutation-put.md_client.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - insertPost(input: PostInput!): Post -} - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int -} - -input PostInput { - body: String - id: Int - title: String - userId: Int -} - -type Query { - firstUser: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__mutation-put.md_merged.snap b/tests/snapshots/execution_spec__mutation-put.md_merged.snap deleted file mode 100644 index 4024b6fdc8..0000000000 --- a/tests/snapshots/execution_spec__mutation-put.md_merged.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query - mutation: Mutation -} - -input PostInput { - body: String - id: Int - title: String - userId: Int -} - -type Mutation { - insertPost(input: PostInput!): Post @http(body: "{{.args.input}}", method: "PUT", path: "/posts/{{.args.input.id}}") -} - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Query { - firstUser: User @http(path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__mutation-put.md_test_0.snap b/tests/snapshots/execution_spec__mutation-put.md_test_0.snap deleted file mode 100644 index a6295cacfd..0000000000 --- a/tests/snapshots/execution_spec__mutation-put.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "insertPost": { - "body": "abc" - } - } - } -} diff --git a/tests/snapshots/execution_spec__mutation.md_client.snap b/tests/snapshots/execution_spec__mutation.md_client.snap deleted file mode 100644 index ae0e38b646..0000000000 --- a/tests/snapshots/execution_spec__mutation.md_client.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mutation { - insertPost(input: PostInput): Post -} - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int -} - -input PostInput { - body: String - title: String - userId: Int -} - -type Query { - firstUser: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query - mutation: Mutation -} diff --git a/tests/snapshots/execution_spec__mutation.md_merged.snap b/tests/snapshots/execution_spec__mutation.md_merged.snap deleted file mode 100644 index 235d2494bd..0000000000 --- a/tests/snapshots/execution_spec__mutation.md_merged.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query - mutation: Mutation -} - -input PostInput { - body: String - title: String - userId: Int -} - -type Mutation { - insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") -} - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Query { - firstUser: User @http(path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__mutation.md_test_0.snap b/tests/snapshots/execution_spec__mutation.md_test_0.snap deleted file mode 100644 index 3d78c855be..0000000000 --- a/tests/snapshots/execution_spec__mutation.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "insertPost": { - "body": "post-body" - } - } - } -} diff --git a/tests/snapshots/execution_spec__n-plus-one-list.md_client.snap b/tests/snapshots/execution_spec__n-plus-one-list.md_client.snap deleted file mode 100644 index 2c8578f544..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one-list.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - foo: [Foo] - fooId: Int! - id: Int! -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - bar: Bar - id: Int! - name: String! -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bars: [Bar] - foos: [Foo] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__n-plus-one-list.md_merged.snap b/tests/snapshots/execution_spec__n-plus-one-list.md_merged.snap deleted file mode 100644 index e87c02bc48..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one-list.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Bar { - foo: [Foo] @http(batchKey: ["id"], path: "/foos", query: [{key: "id", value: "{{.value.fooId}}"}]) - fooId: Int! - id: Int! -} - -type Foo { - bar: Bar @http(batchKey: ["fooId"], path: "/bars", query: [{key: "fooId", value: "{{.value.id}}"}]) - id: Int! - name: String! -} - -type Query { - bars: [Bar] @http(path: "/bars") - foos: [Foo] @http(path: "/foos") -} diff --git a/tests/snapshots/execution_spec__n-plus-one-list.md_test_0.snap b/tests/snapshots/execution_spec__n-plus-one-list.md_test_0.snap deleted file mode 100644 index 65c5d2bcca..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one-list.md_test_0.snap +++ /dev/null @@ -1,52 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "bars": [ - { - "foo": [ - { - "id": 1 - } - ], - "fooId": 1, - "id": 1 - }, - { - "foo": [ - { - "id": 1 - } - ], - "fooId": 1, - "id": 2 - }, - { - "foo": [ - { - "id": 2 - } - ], - "fooId": 2, - "id": 3 - }, - { - "foo": [ - { - "id": 2 - } - ], - "fooId": 2, - "id": 4 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__n-plus-one.md_client.snap b/tests/snapshots/execution_spec__n-plus-one.md_client.snap deleted file mode 100644 index 2c8578f544..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - foo: [Foo] - fooId: Int! - id: Int! -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - bar: Bar - id: Int! - name: String! -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bars: [Bar] - foos: [Foo] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__n-plus-one.md_merged.snap b/tests/snapshots/execution_spec__n-plus-one.md_merged.snap deleted file mode 100644 index e87c02bc48..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://example.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Bar { - foo: [Foo] @http(batchKey: ["id"], path: "/foos", query: [{key: "id", value: "{{.value.fooId}}"}]) - fooId: Int! - id: Int! -} - -type Foo { - bar: Bar @http(batchKey: ["fooId"], path: "/bars", query: [{key: "fooId", value: "{{.value.id}}"}]) - id: Int! - name: String! -} - -type Query { - bars: [Bar] @http(path: "/bars") - foos: [Foo] @http(path: "/foos") -} diff --git a/tests/snapshots/execution_spec__n-plus-one.md_test_0.snap b/tests/snapshots/execution_spec__n-plus-one.md_test_0.snap deleted file mode 100644 index a55ce69948..0000000000 --- a/tests/snapshots/execution_spec__n-plus-one.md_test_0.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "foos": [ - { - "bar": { - "fooId": "1", - "id": 1 - }, - "id": 1, - "name": "foo1" - }, - { - "bar": { - "fooId": "2", - "id": 2 - }, - "id": 2, - "name": "foo2" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__nested-objects.md_client.snap b/tests/snapshots/execution_spec__nested-objects.md_client.snap deleted file mode 100644 index 4669dee5d6..0000000000 --- a/tests/snapshots/execution_spec__nested-objects.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Address { - geo: Geo - street: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Geo { - lat: String - lng: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: Address -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__nested-objects.md_merged.snap b/tests/snapshots/execution_spec__nested-objects.md_merged.snap deleted file mode 100644 index b8aceb5041..0000000000 --- a/tests/snapshots/execution_spec__nested-objects.md_merged.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - geo: Geo - street: String -} - -type Geo { - lat: String - lng: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - address: Address -} diff --git a/tests/snapshots/execution_spec__nested-objects.md_test_0.snap b/tests/snapshots/execution_spec__nested-objects.md_test_0.snap deleted file mode 100644 index dd63e5c9e4..0000000000 --- a/tests/snapshots/execution_spec__nested-objects.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "address": { - "geo": { - "lat": "-37.3159" - } - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__nesting-level3.md_client.snap b/tests/snapshots/execution_spec__nesting-level3.md_client.snap deleted file mode 100644 index 13a4d21006..0000000000 --- a/tests/snapshots/execution_spec__nesting-level3.md_client.snap +++ /dev/null @@ -1,45 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - post: Post -} - -type Todo { - completed: Boolean -} - -scalar Url - -type User { - email: String! - id: Int! - name: String! - phone: String - todos: [Todo] - username: String! - website: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__nesting-level3.md_merged.snap b/tests/snapshots/execution_spec__nesting-level3.md_merged.snap deleted file mode 100644 index d918d257fb..0000000000 --- a/tests/snapshots/execution_spec__nesting-level3.md_merged.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(path: "/users/{{.value.userId}}") - userId: Int! -} - -type Query { - post: Post @http(path: "/posts/1") -} - -type Todo { - completed: Boolean -} - -type User { - email: String! - id: Int! - name: String! - phone: String - todos: [Todo] @http(path: "/users/{{.value.id}}/todos") - username: String! - website: String -} diff --git a/tests/snapshots/execution_spec__nesting-level3.md_test_0.snap b/tests/snapshots/execution_spec__nesting-level3.md_test_0.snap deleted file mode 100644 index ece7a634dc..0000000000 --- a/tests/snapshots/execution_spec__nesting-level3.md_test_0.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "post": { - "user": { - "todos": [ - { - "completed": false - }, - { - "completed": false - }, - { - "completed": false - }, - { - "completed": true - }, - { - "completed": false - }, - { - "completed": false - } - ] - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__nullable-arg-query.md_client.snap b/tests/snapshots/execution_spec__nullable-arg-query.md_client.snap deleted file mode 100644 index 525afe50fa..0000000000 --- a/tests/snapshots/execution_spec__nullable-arg-query.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - users(id: ID): [User] -} - -scalar Url - -type User { - id: ID! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__nullable-arg-query.md_merged.snap b/tests/snapshots/execution_spec__nullable-arg-query.md_merged.snap deleted file mode 100644 index 9472d30879..0000000000 --- a/tests/snapshots/execution_spec__nullable-arg-query.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - users(id: ID): [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) -} - -type User { - id: ID! - name: String! -} diff --git a/tests/snapshots/execution_spec__nullable-arg-query.md_test_0.snap b/tests/snapshots/execution_spec__nullable-arg-query.md_test_0.snap deleted file mode 100644 index fd978fb9e7..0000000000 --- a/tests/snapshots/execution_spec__nullable-arg-query.md_test_0.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "users": [ - { - "id": 1 - }, - { - "id": 2 - }, - { - "id": 3 - }, - { - "id": 4 - }, - { - "id": 5 - }, - { - "id": 6 - }, - { - "id": 7 - }, - { - "id": 8 - }, - { - "id": 9 - }, - { - "id": 10 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__nullable-arg-query.md_test_1.snap b/tests/snapshots/execution_spec__nullable-arg-query.md_test_1.snap deleted file mode 100644 index 529312c684..0000000000 --- a/tests/snapshots/execution_spec__nullable-arg-query.md_test_1.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "users": [ - { - "id": 1 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__omit-index-list.md_client.snap b/tests/snapshots/execution_spec__omit-index-list.md_client.snap deleted file mode 100644 index f36f868741..0000000000 --- a/tests/snapshots/execution_spec__omit-index-list.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - username: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__omit-index-list.md_merged.snap b/tests/snapshots/execution_spec__omit-index-list.md_merged.snap deleted file mode 100644 index 7191b8d138..0000000000 --- a/tests/snapshots/execution_spec__omit-index-list.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query @addField(name: "username", path: ["username", "0", "name"]) { - username: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users") @modify(omit: true) -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__omit-index-list.md_test_0.snap b/tests/snapshots/execution_spec__omit-index-list.md_test_0.snap deleted file mode 100644 index 29d33382cd..0000000000 --- a/tests/snapshots/execution_spec__omit-index-list.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "username": "Leanne Graham" - } - } -} diff --git a/tests/snapshots/execution_spec__omit-many.md_client.snap b/tests/snapshots/execution_spec__omit-many.md_client.snap deleted file mode 100644 index 45c10a3331..0000000000 --- a/tests/snapshots/execution_spec__omit-many.md_client.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - complements: [String] - name: String - zipcode: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__omit-many.md_merged.snap b/tests/snapshots/execution_spec__omit-many.md_merged.snap deleted file mode 100644 index 65cc21941b..0000000000 --- a/tests/snapshots/execution_spec__omit-many.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - city: String - complements: [String] - street: String - zipcode: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "zipcode", path: ["address", "zipcode"]) @addField(name: "complements", path: ["address", "complements"]) { - address: Address @omit - name: String -} diff --git a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_client.snap b/tests/snapshots/execution_spec__omit-resolved-by-parent.md_client.snap deleted file mode 100644 index e0ba3147d9..0000000000 --- a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_merged.snap b/tests/snapshots/execution_spec__omit-resolved-by-parent.md_merged.snap deleted file mode 100644 index e44b9d28da..0000000000 --- a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_merged.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - street: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "address", path: ["address", "street"]) { - address: Address @modify(omit: true) -} diff --git a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_test_0.snap b/tests/snapshots/execution_spec__omit-resolved-by-parent.md_test_0.snap deleted file mode 100644 index 83acf38a17..0000000000 --- a/tests/snapshots/execution_spec__omit-resolved-by-parent.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "address": "Kulas Light" - } - } - } -} diff --git a/tests/snapshots/execution_spec__recursive-type-json.md_client.snap b/tests/snapshots/execution_spec__recursive-type-json.md_client.snap deleted file mode 100644 index b1fff57326..0000000000 --- a/tests/snapshots/execution_spec__recursive-type-json.md_client.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - friend: User - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__recursive-type-json.md_merged.snap b/tests/snapshots/execution_spec__recursive-type-json.md_merged.snap deleted file mode 100644 index 530f94d61d..0000000000 --- a/tests/snapshots/execution_spec__recursive-type-json.md_merged.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com", httpCache: true) { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/1") -} - -type User { - friend: User @http(path: "/friends/1") - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__recursive-type-json.md_test_0.snap b/tests/snapshots/execution_spec__recursive-type-json.md_test_0.snap deleted file mode 100644 index bc1aea6a46..0000000000 --- a/tests/snapshots/execution_spec__recursive-type-json.md_test_0.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "User1", - "id": 1, - "friend": { - "name": "User2", - "id": 2, - "friend": { - "name": "User2", - "id": 2 - } - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__recursive-types.md_client.snap b/tests/snapshots/execution_spec__recursive-types.md_client.snap deleted file mode 100644 index 51246a10f0..0000000000 --- a/tests/snapshots/execution_spec__recursive-types.md_client.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - friend: User - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__recursive-types.md_merged.snap b/tests/snapshots/execution_spec__recursive-types.md_merged.snap deleted file mode 100644 index a18ea152d0..0000000000 --- a/tests/snapshots/execution_spec__recursive-types.md_merged.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - user: User @http(path: "/users/1") -} - -type User { - friend: User @http(path: "/friends/1") - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__recursive-types.md_test_0.snap b/tests/snapshots/execution_spec__recursive-types.md_test_0.snap deleted file mode 100644 index bc1aea6a46..0000000000 --- a/tests/snapshots/execution_spec__recursive-types.md_test_0.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "User1", - "id": 1, - "friend": { - "name": "User2", - "id": 2, - "friend": { - "name": "User2", - "id": 2 - } - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__ref-other-nested.md_client.snap b/tests/snapshots/execution_spec__ref-other-nested.md_client.snap deleted file mode 100644 index 372a3a0aa5..0000000000 --- a/tests/snapshots/execution_spec__ref-other-nested.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser: User1 -} - -scalar Url - -type User { - id: Int - name: String -} - -type User1 { - user1: User2 -} - -type User2 { - user2: User -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__ref-other-nested.md_merged.snap b/tests/snapshots/execution_spec__ref-other-nested.md_merged.snap deleted file mode 100644 index 6b55f012b0..0000000000 --- a/tests/snapshots/execution_spec__ref-other-nested.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - firstUser: User1 @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} - -type User1 { - user1: User2 -} - -type User2 { - user2: User @http(baseURL: "https://jsonplaceholder.typicode.com", path: "/users/1") -} diff --git a/tests/snapshots/execution_spec__ref-other-nested.md_test_0.snap b/tests/snapshots/execution_spec__ref-other-nested.md_test_0.snap deleted file mode 100644 index a0257a5d85..0000000000 --- a/tests/snapshots/execution_spec__ref-other-nested.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "user1": { - "user2": { - "name": "Leanne Graham" - } - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__ref-other.md_client.snap b/tests/snapshots/execution_spec__ref-other.md_client.snap deleted file mode 100644 index f43d59fc36..0000000000 --- a/tests/snapshots/execution_spec__ref-other.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser: User1 -} - -scalar Url - -type User { - id: Int - name: String -} - -type User1 { - user1: User -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__ref-other.md_merged.snap b/tests/snapshots/execution_spec__ref-other.md_merged.snap deleted file mode 100644 index 36e2544bb7..0000000000 --- a/tests/snapshots/execution_spec__ref-other.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - firstUser: User1 -} - -type User { - id: Int - name: String -} - -type User1 { - user1: User @http(path: "/users/1") -} diff --git a/tests/snapshots/execution_spec__ref-other.md_test_0.snap b/tests/snapshots/execution_spec__ref-other.md_test_0.snap deleted file mode 100644 index e1803e092c..0000000000 --- a/tests/snapshots/execution_spec__ref-other.md_test_0.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "user1": { - "name": "Leanne Graham" - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__rename-field.md_client.snap b/tests/snapshots/execution_spec__rename-field.md_client.snap deleted file mode 100644 index 24798b8ae8..0000000000 --- a/tests/snapshots/execution_spec__rename-field.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user1: User - user2: User -} - -scalar Url - -type User { - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__rename-field.md_merged.snap b/tests/snapshots/execution_spec__rename-field.md_merged.snap deleted file mode 100644 index c8f3ec81bf..0000000000 --- a/tests/snapshots/execution_spec__rename-field.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - person1: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") @modify(name: "user1") - person2: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/2") @modify(name: "user2") -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__rename-field.md_test_0.snap b/tests/snapshots/execution_spec__rename-field.md_test_0.snap deleted file mode 100644 index 2a1942ca5c..0000000000 --- a/tests/snapshots/execution_spec__rename-field.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user1": { - "name": "Leanne Graham" - } - } - } -} diff --git a/tests/snapshots/execution_spec__rename-field.md_test_1.snap b/tests/snapshots/execution_spec__rename-field.md_test_1.snap deleted file mode 100644 index 4543945b2e..0000000000 --- a/tests/snapshots/execution_spec__rename-field.md_test_1.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user2": { - "name": "Ervin Howell" - } - } - } -} diff --git a/tests/snapshots/execution_spec__request-to-upstream-batching.md_client.snap b/tests/snapshots/execution_spec__request-to-upstream-batching.md_client.snap deleted file mode 100644 index 33012a438b..0000000000 --- a/tests/snapshots/execution_spec__request-to-upstream-batching.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__request-to-upstream-batching.md_merged.snap b/tests/snapshots/execution_spec__request-to-upstream-batching.md_merged.snap deleted file mode 100644 index 26e703dfec..0000000000 --- a/tests/snapshots/execution_spec__request-to-upstream-batching.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { - query: Query -} - -type Query { - user(id: Int!): User @http(baseURL: "http://jsonplaceholder.typicode.com", batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__request-to-upstream-batching.md_test_0.snap b/tests/snapshots/execution_spec__request-to-upstream-batching.md_test_0.snap deleted file mode 100644 index ae3cd214fb..0000000000 --- a/tests/snapshots/execution_spec__request-to-upstream-batching.md_test_0.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": [ - { - "data": { - "user": { - "id": 1, - "name": "foo" - } - } - }, - { - "data": { - "user": { - "id": 2, - "name": "bar" - } - } - } - ] -} diff --git a/tests/snapshots/execution_spec__resolve-with-headers.md_client.snap b/tests/snapshots/execution_spec__resolve-with-headers.md_client.snap deleted file mode 100644 index e5a89fac93..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-headers.md_client.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String! - id: ID! - title: String! - userId: ID! -} - -type Query { - post1: Post -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__resolve-with-headers.md_merged.snap b/tests/snapshots/execution_spec__resolve-with-headers.md_merged.snap deleted file mode 100644 index 0a81622568..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-headers.md_merged.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(allowedHeaders: ["authorization"]) { - query: Query -} - -type Post { - body: String! - id: ID! - title: String! - userId: ID! -} - -type Query { - post1: Post @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/posts/{{.headers.authorization}}") -} diff --git a/tests/snapshots/execution_spec__resolve-with-headers.md_test_0.snap b/tests/snapshots/execution_spec__resolve-with-headers.md_test_0.snap deleted file mode 100644 index 194dde9025..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-headers.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "post1": { - "title": "post title" - } - } - } -} diff --git a/tests/snapshots/execution_spec__resolve-with-vars.md_client.snap b/tests/snapshots/execution_spec__resolve-with-vars.md_client.snap deleted file mode 100644 index f8f18cc475..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-vars.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__resolve-with-vars.md_merged.snap b/tests/snapshots/execution_spec__resolve-with-vars.md_merged.snap deleted file mode 100644 index fce4f2eaa2..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-vars.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(vars: [{key: "id", value: "1"}]) @upstream { - query: Query -} - -type Query { - user: [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.vars.id}}"}]) -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__resolve-with-vars.md_test_0.snap b/tests/snapshots/execution_spec__resolve-with-vars.md_test_0.snap deleted file mode 100644 index 9e1032ec3c..0000000000 --- a/tests/snapshots/execution_spec__resolve-with-vars.md_test_0.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": [ - { - "name": "Leanne Graham" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__resolved-by-parent.md_client.snap b/tests/snapshots/execution_spec__resolved-by-parent.md_client.snap deleted file mode 100644 index e0ba3147d9..0000000000 --- a/tests/snapshots/execution_spec__resolved-by-parent.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - address: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__resolved-by-parent.md_merged.snap b/tests/snapshots/execution_spec__resolved-by-parent.md_merged.snap deleted file mode 100644 index e44b9d28da..0000000000 --- a/tests/snapshots/execution_spec__resolved-by-parent.md_merged.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Address { - street: String -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User @addField(name: "address", path: ["address", "street"]) { - address: Address @modify(omit: true) -} diff --git a/tests/snapshots/execution_spec__resolved-by-parent.md_test_0.snap b/tests/snapshots/execution_spec__resolved-by-parent.md_test_0.snap deleted file mode 100644 index 83acf38a17..0000000000 --- a/tests/snapshots/execution_spec__resolved-by-parent.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "address": "Kulas Light" - } - } - } -} diff --git a/tests/snapshots/execution_spec__rest-api-error.md_client.snap b/tests/snapshots/execution_spec__rest-api-error.md_client.snap deleted file mode 100644 index b2c75a55b8..0000000000 --- a/tests/snapshots/execution_spec__rest-api-error.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__rest-api-error.md_merged.snap b/tests/snapshots/execution_spec__rest-api-error.md_merged.snap deleted file mode 100644 index 82c5c02b37..0000000000 --- a/tests/snapshots/execution_spec__rest-api-error.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/{{.args.id}}") -} - -type User { - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__rest-api-error.md_test_0.snap b/tests/snapshots/execution_spec__rest-api-error.md_test_0.snap deleted file mode 100644 index dce9c4ce8d..0000000000 --- a/tests/snapshots/execution_spec__rest-api-error.md_test_0.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 500, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: non-null types require a return value", - "locations": [ - { - "line": 3, - "column": 5 - } - ], - "path": [ - "user", - "id" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__rest-api-post.md_client.snap b/tests/snapshots/execution_spec__rest-api-post.md_client.snap deleted file mode 100644 index b2c75a55b8..0000000000 --- a/tests/snapshots/execution_spec__rest-api-post.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__rest-api-post.md_merged.snap b/tests/snapshots/execution_spec__rest-api-post.md_merged.snap deleted file mode 100644 index 82c5c02b37..0000000000 --- a/tests/snapshots/execution_spec__rest-api-post.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/{{.args.id}}") -} - -type User { - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__rest-api-post.md_test_0.snap b/tests/snapshots/execution_spec__rest-api-post.md_test_0.snap deleted file mode 100644 index 3bb91ee518..0000000000 --- a/tests/snapshots/execution_spec__rest-api-post.md_test_0.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "id": 1, - "name": "foo" - } -} diff --git a/tests/snapshots/execution_spec__rest-api.md_client.snap b/tests/snapshots/execution_spec__rest-api.md_client.snap deleted file mode 100644 index b2c75a55b8..0000000000 --- a/tests/snapshots/execution_spec__rest-api.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int! - name: String! -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__rest-api.md_merged.snap b/tests/snapshots/execution_spec__rest-api.md_merged.snap deleted file mode 100644 index 82c5c02b37..0000000000 --- a/tests/snapshots/execution_spec__rest-api.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") @link(src: "operation-user.graphql", type: Operation) { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/{{.args.id}}") -} - -type User { - id: Int! - name: String! -} diff --git a/tests/snapshots/execution_spec__rest-api.md_test_0.snap b/tests/snapshots/execution_spec__rest-api.md_test_0.snap deleted file mode 100644 index 3bb91ee518..0000000000 --- a/tests/snapshots/execution_spec__rest-api.md_test_0.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "id": 1, - "name": "foo" - } -} diff --git a/tests/snapshots/execution_spec__showcase.md_client.snap b/tests/snapshots/execution_spec__showcase.md_client.snap deleted file mode 100644 index 9f20789b0a..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - not_user: User -} - -scalar Url - -type User { - not_id: Int - not_name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__showcase.md_merged.snap b/tests/snapshots/execution_spec__showcase.md_merged.snap deleted file mode 100644 index 403c78fe18..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(showcase: true) @upstream { - query: Query -} - -type Query { - not_user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - not_id: Int - not_name: String -} diff --git a/tests/snapshots/execution_spec__showcase.md_test_0.snap b/tests/snapshots/execution_spec__showcase.md_test_0.snap deleted file mode 100644 index c1d6f66212..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__showcase.md_test_1.snap b/tests/snapshots/execution_spec__showcase.md_test_1.snap deleted file mode 100644 index b8e6363028..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_test_1.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "No Config URL specified" - } - ] - } -} diff --git a/tests/snapshots/execution_spec__showcase.md_test_2.snap b/tests/snapshots/execution_spec__showcase.md_test_2.snap deleted file mode 100644 index 33505dda26..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_test_2.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Invalid Config URL specified" - } - ] - } -} diff --git a/tests/snapshots/execution_spec__showcase.md_test_3.snap b/tests/snapshots/execution_spec__showcase.md_test_3.snap deleted file mode 100644 index 645d519413..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_test_3.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Failed to read config: Validation Error\n• --> 1:1\n |\n1 | \"dsjfsjdfjdsfjkdskjfjkds\"\n | ^---\n |\n = expected type_system_definition\n" - } - ] - } -} diff --git a/tests/snapshots/execution_spec__showcase.md_test_4.snap b/tests/snapshots/execution_spec__showcase.md_test_4.snap deleted file mode 100644 index 1b88aa8980..0000000000 --- a/tests/snapshots/execution_spec__showcase.md_test_4.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Unexpected GraphQL Request: invalid type: map, expected a string at line 1 column 9" - } - ] - } -} diff --git a/tests/snapshots/execution_spec__simple-graphql.md_client.snap b/tests/snapshots/execution_spec__simple-graphql.md_client.snap deleted file mode 100644 index 84d2907e22..0000000000 --- a/tests/snapshots/execution_spec__simple-graphql.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__simple-graphql.md_merged.snap b/tests/snapshots/execution_spec__simple-graphql.md_merged.snap deleted file mode 100644 index 822924f58f..0000000000 --- a/tests/snapshots/execution_spec__simple-graphql.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__simple-graphql.md_test_0.snap b/tests/snapshots/execution_spec__simple-graphql.md_test_0.snap deleted file mode 100644 index c1d6f66212..0000000000 --- a/tests/snapshots/execution_spec__simple-graphql.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__simple-graphql.md_test_1.snap b/tests/snapshots/execution_spec__simple-graphql.md_test_1.snap deleted file mode 100644 index 1b88aa8980..0000000000 --- a/tests/snapshots/execution_spec__simple-graphql.md_test_1.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "Unexpected GraphQL Request: invalid type: map, expected a string at line 1 column 9" - } - ] - } -} diff --git a/tests/snapshots/execution_spec__simple-query.md_client.snap b/tests/snapshots/execution_spec__simple-query.md_client.snap deleted file mode 100644 index 2ae445a996..0000000000 --- a/tests/snapshots/execution_spec__simple-query.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__simple-query.md_merged.snap b/tests/snapshots/execution_spec__simple-query.md_merged.snap deleted file mode 100644 index e68b264eed..0000000000 --- a/tests/snapshots/execution_spec__simple-query.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - firstUser: User @http(path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__simple-query.md_test_0.snap b/tests/snapshots/execution_spec__simple-query.md_test_0.snap deleted file mode 100644 index fd37d2e038..0000000000 --- a/tests/snapshots/execution_spec__simple-query.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-add-field-list.md_client.snap b/tests/snapshots/execution_spec__test-add-field-list.md_client.snap deleted file mode 100644 index e61e1d995e..0000000000 --- a/tests/snapshots/execution_spec__test-add-field-list.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type A { - b: B -} - -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - a: A -} - -scalar JSON - -scalar PhoneNumber - -type Query { - b: B - foo: [Foo] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-add-field-list.md_merged.snap b/tests/snapshots/execution_spec__test-add-field-list.md_merged.snap deleted file mode 100644 index 41c71c9237..0000000000 --- a/tests/snapshots/execution_spec__test-add-field-list.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "b", path: ["foo", "a", "0", "b"]) { - foo: [Foo] @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-add-field.md_client.snap b/tests/snapshots/execution_spec__test-add-field.md_client.snap deleted file mode 100644 index a0399c6f79..0000000000 --- a/tests/snapshots/execution_spec__test-add-field.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type A { - b: B -} - -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - a: A -} - -scalar JSON - -scalar PhoneNumber - -type Query { - b: B - foo: Foo -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-add-field.md_merged.snap b/tests/snapshots/execution_spec__test-add-field.md_merged.snap deleted file mode 100644 index 3b67cb64aa..0000000000 --- a/tests/snapshots/execution_spec__test-add-field.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "b", path: ["foo", "a", "b"]) { - foo: Foo @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_client.snap b/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_client.snap deleted file mode 100644 index f88af82b65..0000000000 --- a/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_client.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -enum Foo { - BAR - BAZ -} - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: Foo - hello: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_merged.snap b/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_merged.snap deleted file mode 100644 index b4caf4570a..0000000000 --- a/tests/snapshots/execution_spec__test-add-link-to-empty-config.md_merged.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream @link(src: "link-expr.graphql", type: Config) @link(src: "link-enum.graphql", type: Config) { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-batching-group-by.md_client.snap b/tests/snapshots/execution_spec__test-batching-group-by.md_client.snap deleted file mode 100644 index f8e5c29910..0000000000 --- a/tests/snapshots/execution_spec__test-batching-group-by.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-batching-group-by.md_merged.snap b/tests/snapshots/execution_spec__test-batching-group-by.md_merged.snap deleted file mode 100644 index ef9d73c5ea..0000000000 --- a/tests/snapshots/execution_spec__test-batching-group-by.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 4000) @upstream(baseURL: "http://abc.com", batch: {delay: 1, headers: [], maxSize: 1000}) { - query: Query -} - -type Post { - body: String - id: Int - title: String - user: User @http(batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.value.userId}}"}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts?id=1&id=11") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-cache.md_client.snap b/tests/snapshots/execution_spec__test-cache.md_client.snap deleted file mode 100644 index 84d2907e22..0000000000 --- a/tests/snapshots/execution_spec__test-cache.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-cache.md_merged.snap b/tests/snapshots/execution_spec__test-cache.md_merged.snap deleted file mode 100644 index 769c557d4d..0000000000 --- a/tests/snapshots/execution_spec__test-cache.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - user: User @http(path: "/foo") @cache(maxAge: 300) -} - -type User @cache(maxAge: 900) { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-conflict-allowed-headers.md_merged.snap b/tests/snapshots/execution_spec__test-conflict-allowed-headers.md_merged.snap deleted file mode 100644 index 264403bbf5..0000000000 --- a/tests/snapshots/execution_spec__test-conflict-allowed-headers.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(allowedHeaders: ["a", "b", "c", "d"]) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/snapshots/execution_spec__test-conflict-vars.md_merged.snap b/tests/snapshots/execution_spec__test-conflict-vars.md_merged.snap deleted file mode 100644 index 58fe751643..0000000000 --- a/tests/snapshots/execution_spec__test-conflict-vars.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(vars: [{key: "a", value: "b"}, {key: "c", value: "d"}, {key: "p", value: "q"}]) @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/snapshots/execution_spec__test-custom-scalar.md_client.snap b/tests/snapshots/execution_spec__test-custom-scalar.md_client.snap deleted file mode 100644 index 2e238aa2c0..0000000000 --- a/tests/snapshots/execution_spec__test-custom-scalar.md_client.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar Json - -scalar PhoneNumber - -type Query { - foo: [Json] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-custom-scalar.md_merged.snap b/tests/snapshots/execution_spec__test-custom-scalar.md_merged.snap deleted file mode 100644 index 4ef1b123aa..0000000000 --- a/tests/snapshots/execution_spec__test-custom-scalar.md_merged.snap +++ /dev/null @@ -1,13 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -scalar Json - -type Query { - foo: [Json] @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-custom-types.md_client.snap b/tests/snapshots/execution_spec__test-custom-types.md_client.snap deleted file mode 100644 index f0d4ac3e87..0000000000 --- a/tests/snapshots/execution_spec__test-custom-types.md_client.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type Mut { - insertPost(input: PostInput): Post -} - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int -} - -input PostInput { - body: String - title: String - userId: Int -} - -type Que { - posts: [Post] -} - -scalar Url - -schema { - query: Que - mutation: Mut -} diff --git a/tests/snapshots/execution_spec__test-custom-types.md_merged.snap b/tests/snapshots/execution_spec__test-custom-types.md_merged.snap deleted file mode 100644 index 6ec581a1d0..0000000000 --- a/tests/snapshots/execution_spec__test-custom-types.md_merged.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Que - mutation: Mut -} - -input PostInput { - body: String - title: String - userId: Int -} - -type Mut { - insertPost(input: PostInput): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") -} - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Que { - posts: [Post] @expr(body: [{id: 1}]) -} diff --git a/tests/snapshots/execution_spec__test-description-many.md_client.snap b/tests/snapshots/execution_spec__test-description-many.md_client.snap deleted file mode 100644 index 4df606385d..0000000000 --- a/tests/snapshots/execution_spec__test-description-many.md_client.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - """ - This is test2 - """ - baz: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - """ - This is test - """ - foo: Bar -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-description-many.md_merged.snap b/tests/snapshots/execution_spec__test-description-many.md_merged.snap deleted file mode 100644 index bea9751ea9..0000000000 --- a/tests/snapshots/execution_spec__test-description-many.md_merged.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Bar { - """ - This is test2 - """ - baz: String -} - -type Query { - """ - This is test - """ - foo: Bar @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-enum-default.md_client.snap b/tests/snapshots/execution_spec__test-enum-default.md_client.snap deleted file mode 100644 index 3bf9fcb1dc..0000000000 --- a/tests/snapshots/execution_spec__test-enum-default.md_client.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - foo: Status - id: Int -} - -type NewsData { - news: [News]! -} - -scalar PhoneNumber - -type Query { - news: NewsData! -} - -enum Status { - DRAFT - ND - PUBLISHED -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-enum-default.md_merged.snap b/tests/snapshots/execution_spec__test-enum-default.md_merged.snap deleted file mode 100644 index 0ae232ebb6..0000000000 --- a/tests/snapshots/execution_spec__test-enum-default.md_merged.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8080) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "./service.proto", type: Protobuf) { - query: Query -} - -enum Status { - DRAFT - ND - PUBLISHED -} - -type News { - foo: Status - id: Int -} - -type NewsData { - news: [News]! -} - -type NewsInput { - id: Int -} - -type Query { - news: NewsData! @grpc(method: "news.NewsService.GetAllNews") -} diff --git a/tests/snapshots/execution_spec__test-enum-default.md_test_0.snap b/tests/snapshots/execution_spec__test-enum-default.md_test_0.snap deleted file mode 100644 index 6a14caece7..0000000000 --- a/tests/snapshots/execution_spec__test-enum-default.md_test_0.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "news": { - "news": [ - { - "id": 1, - "foo": "PUBLISHED" - }, - { - "id": 2, - "foo": "DRAFT" - }, - { - "id": 3, - "foo": "ND" - } - ] - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-enum-merge.md_merged.snap b/tests/snapshots/execution_spec__test-enum-merge.md_merged.snap deleted file mode 100644 index 99d8747536..0000000000 --- a/tests/snapshots/execution_spec__test-enum-merge.md_merged.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -enum Foo { - BAR - BAZ - BOOM -} - -type Query { - foo: Foo @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-enum.md_client.snap b/tests/snapshots/execution_spec__test-enum.md_client.snap deleted file mode 100644 index c4809642b5..0000000000 --- a/tests/snapshots/execution_spec__test-enum.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -enum Foo { - BAR - BAZ -} - -scalar JSON - -scalar PhoneNumber - -type Query { - foo(val: String!): Foo -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-enum.md_merged.snap b/tests/snapshots/execution_spec__test-enum.md_merged.snap deleted file mode 100644 index 23b88305d1..0000000000 --- a/tests/snapshots/execution_spec__test-enum.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://localhost:8080") { - query: Query -} - -enum Foo { - BAR - BAZ -} - -type Query { - foo(val: String!): Foo @expr(body: "{{.args.val}}") -} diff --git a/tests/snapshots/execution_spec__test-enum.md_test_0.snap b/tests/snapshots/execution_spec__test-enum.md_test_0.snap deleted file mode 100644 index 1faa1c2e5e..0000000000 --- a/tests/snapshots/execution_spec__test-enum.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "foo": "BAR" - } - } -} diff --git a/tests/snapshots/execution_spec__test-enum.md_test_1.snap b/tests/snapshots/execution_spec__test-enum.md_test_1.snap deleted file mode 100644 index 7c41e7a967..0000000000 --- a/tests/snapshots/execution_spec__test-enum.md_test_1.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "foo": "BAZ" - } - } -} diff --git a/tests/snapshots/execution_spec__test-enum.md_test_2.snap b/tests/snapshots/execution_spec__test-enum.md_test_2.snap deleted file mode 100644 index a2ba8f23dc..0000000000 --- a/tests/snapshots/execution_spec__test-enum.md_test_2.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid item for enum \"Foo\"", - "locations": [ - { - "line": 1, - "column": 9 - } - ], - "path": [ - "foo" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-expr-with-mustache.md_client.snap b/tests/snapshots/execution_spec__test-expr-with-mustache.md_client.snap deleted file mode 100644 index c35daebf5a..0000000000 --- a/tests/snapshots/execution_spec__test-expr-with-mustache.md_client.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type A { - a: Int - bc: BC -} - -type BC { - b: [Int] - c: String - d: Int - f: D - g: Boolean -} - -type D { - e: Int -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - a: A -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-expr-with-mustache.md_merged.snap b/tests/snapshots/execution_spec__test-expr-with-mustache.md_merged.snap deleted file mode 100644 index fcacfe4956..0000000000 --- a/tests/snapshots/execution_spec__test-expr-with-mustache.md_merged.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type A { - a: Int - b: [Int] @modify(omit: true) - bc: BC @expr(body: {b: "{{.value.b}}", c: "{{.value.c}}", d: "{{.value.d.e}}", f: "{{.value.d}}", g: "{{.value.g}}"}) - c: String @modify(omit: true) - d: D @modify(omit: true) - g: Boolean @modify(omit: true) -} - -type BC { - b: [Int] - c: String - d: Int - f: D - g: Boolean -} - -type D { - e: Int -} - -type Query { - a: A @expr(body: {a: 0, b: [1, 2, 3], c: "test", d: {e: 1}, g: true}) -} diff --git a/tests/snapshots/execution_spec__test-expr-with-mustache.md_test_0.snap b/tests/snapshots/execution_spec__test-expr-with-mustache.md_test_0.snap deleted file mode 100644 index 6968e94c17..0000000000 --- a/tests/snapshots/execution_spec__test-expr-with-mustache.md_test_0.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "a": { - "bc": { - "b": [ - 1, - 2, - 3 - ], - "c": "test", - "d": 1, - "f": { - "e": 1 - }, - "g": true - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-expr.md_client.snap b/tests/snapshots/execution_spec__test-expr.md_client.snap deleted file mode 100644 index 60f26910ce..0000000000 --- a/tests/snapshots/execution_spec__test-expr.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hello: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-expr.md_merged.snap b/tests/snapshots/execution_spec__test-expr.md_merged.snap deleted file mode 100644 index d62956f25c..0000000000 --- a/tests/snapshots/execution_spec__test-expr.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - hello: String @expr(body: "Hello from server") -} diff --git a/tests/snapshots/execution_spec__test-graphqlsource.md_client.snap b/tests/snapshots/execution_spec__test-graphqlsource.md_client.snap deleted file mode 100644 index 4672cc580f..0000000000 --- a/tests/snapshots/execution_spec__test-graphqlsource.md_client.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int! - user: User - userId: Int! -} - -type Query { - post(id: Int!): Post -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-graphqlsource.md_merged.snap b/tests/snapshots/execution_spec__test-graphqlsource.md_merged.snap deleted file mode 100644 index 4a4e706f31..0000000000 --- a/tests/snapshots/execution_spec__test-graphqlsource.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://localhost:8000/graphql") { - query: Query -} - -type Post { - id: Int! - user: User @graphQL(args: [{key: "id", value: "{{.value.userId}}"}], name: "user") - userId: Int! -} - -type Query { - post(id: Int!): Post @http(baseURL: "http://jsonplacheholder.typicode.com", path: "/posts/{{.args.id}}") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-grpc.md_client.snap b/tests/snapshots/execution_spec__test-grpc.md_client.snap deleted file mode 100644 index d439ec7a60..0000000000 --- a/tests/snapshots/execution_spec__test-grpc.md_client.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -scalar PhoneNumber - -type Query { - news: NewsData! - newsById(news: NewsInput!): News! - newsByIdBatch(news: NewsInput!): News! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-grpc.md_merged.snap b/tests/snapshots/execution_spec__test-grpc.md_merged.snap deleted file mode 100644 index 3adb497b75..0000000000 --- a/tests/snapshots/execution_spec__test-grpc.md_merged.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: [], maxSize: 1000}) @link(id: "news", src: "news.proto", type: Protobuf) { - query: Query -} - -input NewsInput { - body: String - id: Int - postImage: String - title: String -} - -type News { - body: String - id: Int - postImage: String - title: String -} - -type NewsData { - news: [News]! -} - -type Query { - news: NewsData! @grpc(method: "news.NewsService.GetAllNews") - newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") - newsByIdBatch(news: NewsInput!): News! @grpc(body: "{{.args.news}}", batchKey: ["news", "id"], method: "news.NewsService.GetMultipleNews") -} diff --git a/tests/snapshots/execution_spec__test-http-baseurl.md_client.snap b/tests/snapshots/execution_spec__test-http-baseurl.md_client.snap deleted file mode 100644 index c00421d8f4..0000000000 --- a/tests/snapshots/execution_spec__test-http-baseurl.md_client.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - bar: String - foo: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-http-baseurl.md_merged.snap b/tests/snapshots/execution_spec__test-http-baseurl.md_merged.snap deleted file mode 100644 index 65cf378264..0000000000 --- a/tests/snapshots/execution_spec__test-http-baseurl.md_merged.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://abc.com") { - query: Query -} - -type Query { - bar: String @http(path: "/bar") - foo: String @http(baseURL: "http://foo.com", path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-http-headers.md_client.snap b/tests/snapshots/execution_spec__test-http-headers.md_client.snap deleted file mode 100644 index 98032c71c4..0000000000 --- a/tests/snapshots/execution_spec__test-http-headers.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-http-headers.md_merged.snap b/tests/snapshots/execution_spec__test-http-headers.md_merged.snap deleted file mode 100644 index 8f082a2028..0000000000 --- a/tests/snapshots/execution_spec__test-http-headers.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://localhost:4000") { - query: Query -} - -type Query { - foo: String @http(headers: [{key: "foo", value: "bar"}], path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-http-tmpl.md_client.snap b/tests/snapshots/execution_spec__test-http-tmpl.md_client.snap deleted file mode 100644 index c0736cc312..0000000000 --- a/tests/snapshots/execution_spec__test-http-tmpl.md_client.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int - user: User - userId: Int! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-http-tmpl.md_merged.snap b/tests/snapshots/execution_spec__test-http-tmpl.md_merged.snap deleted file mode 100644 index deb80e3441..0000000000 --- a/tests/snapshots/execution_spec__test-http-tmpl.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Post { - id: Int - user: User @http(path: "/users", query: [{key: "id", value: "{{.value.userId}}"}]) - userId: Int! -} - -type Query { - posts: [Post] @http(path: "/posts") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_client.snap b/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_client.snap deleted file mode 100644 index c8498e4143..0000000000 --- a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_client.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type A { - a: Int - bc: BC -} - -type BC { - d: D - f: Boolean -} - -type D { - e: Int -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - a: A -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_merged.snap b/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_merged.snap deleted file mode 100644 index b7b1b080e8..0000000000 --- a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_merged.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type A { - a: Int - bc: BC @expr(body: {d: "{{.value.d}}", f: "{{.value.f}}"}) - d: D @modify(omit: true) -} - -type BC { - d: D - f: Boolean -} - -type D { - e: Int -} - -type Query { - a: A @http(baseURL: "http://localhost:3000", path: "/a") -} diff --git a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_test_0.snap b/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_test_0.snap deleted file mode 100644 index 299eae2a4d..0000000000 --- a/tests/snapshots/execution_spec__test-http-with-mustache-expr.md_test_0.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "a": { - "bc": { - "d": { - "e": 1 - }, - "f": true - } - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-http.md_client.snap b/tests/snapshots/execution_spec__test-http.md_client.snap deleted file mode 100644 index c1d625a8c9..0000000000 --- a/tests/snapshots/execution_spec__test-http.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-http.md_merged.snap b/tests/snapshots/execution_spec__test-http.md_merged.snap deleted file mode 100644 index 7e75c573bb..0000000000 --- a/tests/snapshots/execution_spec__test-http.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - foo: [User] @http(path: "/users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-inline-list.md_client.snap b/tests/snapshots/execution_spec__test-inline-list.md_client.snap deleted file mode 100644 index 01443ed483..0000000000 --- a/tests/snapshots/execution_spec__test-inline-list.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-inline-list.md_merged.snap b/tests/snapshots/execution_spec__test-inline-list.md_merged.snap deleted file mode 100644 index edfd9e8fcd..0000000000 --- a/tests/snapshots/execution_spec__test-inline-list.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "foo", path: ["foo", "a", "0", "b"]) { - foo: [Foo] @http(path: "/foo") @modify(omit: true) -} diff --git a/tests/snapshots/execution_spec__test-inline.md_client.snap b/tests/snapshots/execution_spec__test-inline.md_client.snap deleted file mode 100644 index 01443ed483..0000000000 --- a/tests/snapshots/execution_spec__test-inline.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-inline.md_merged.snap b/tests/snapshots/execution_spec__test-inline.md_merged.snap deleted file mode 100644 index 358851e6ca..0000000000 --- a/tests/snapshots/execution_spec__test-inline.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "foo", path: ["foo", "a", "b"]) { - foo: Foo @http(path: "/foo") @modify(omit: true) -} diff --git a/tests/snapshots/execution_spec__test-interface-result.md_client.snap b/tests/snapshots/execution_spec__test-interface-result.md_client.snap deleted file mode 100644 index bb4dfdd777..0000000000 --- a/tests/snapshots/execution_spec__test-interface-result.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B implements IA { - a: String - b: String -} - -scalar Date - -scalar Email - -scalar Empty - -interface IA { - a: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bar: IA -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-interface-result.md_merged.snap b/tests/snapshots/execution_spec__test-interface-result.md_merged.snap deleted file mode 100644 index 3412106bcb..0000000000 --- a/tests/snapshots/execution_spec__test-interface-result.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -interface IA { - a: String -} - -type B implements IA { - a: String - b: String -} - -type Query { - bar: IA @http(path: "/user") -} diff --git a/tests/snapshots/execution_spec__test-interface.md_client.snap b/tests/snapshots/execution_spec__test-interface.md_client.snap deleted file mode 100644 index cda634864d..0000000000 --- a/tests/snapshots/execution_spec__test-interface.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B implements IA { - a: String - b: String -} - -scalar Date - -scalar Email - -scalar Empty - -interface IA { - a: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bar: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-interface.md_merged.snap b/tests/snapshots/execution_spec__test-interface.md_merged.snap deleted file mode 100644 index 062f7daea9..0000000000 --- a/tests/snapshots/execution_spec__test-interface.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -interface IA { - a: String -} - -type B implements IA { - a: String - b: String -} - -type Query { - bar: B @http(path: "/user") -} diff --git a/tests/snapshots/execution_spec__test-js-request-reponse.md_client.snap b/tests/snapshots/execution_spec__test-js-request-reponse.md_client.snap deleted file mode 100644 index 1d9cea2dc3..0000000000 --- a/tests/snapshots/execution_spec__test-js-request-reponse.md_client.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hello: String - hi: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-js-request-reponse.md_merged.snap b/tests/snapshots/execution_spec__test-js-request-reponse.md_merged.snap deleted file mode 100644 index 3102d752cb..0000000000 --- a/tests/snapshots/execution_spec__test-js-request-reponse.md_merged.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream @link(src: "test.js", type: Script) { - query: Query -} - -type Query { - hello: String @http(baseURL: "http://localhost:3000", path: "/hello") - hi: String @http(baseURL: "http://localhost:3000", path: "/hi") -} diff --git a/tests/snapshots/execution_spec__test-js-request-reponse.md_test_0.snap b/tests/snapshots/execution_spec__test-js-request-reponse.md_test_0.snap deleted file mode 100644 index 8c91ac6997..0000000000 --- a/tests/snapshots/execution_spec__test-js-request-reponse.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "hi": "hello world" - } - } -} diff --git a/tests/snapshots/execution_spec__test-merge-batch.md_merged.snap b/tests/snapshots/execution_spec__test-merge-batch.md_merged.snap deleted file mode 100644 index e1884682b8..0000000000 --- a/tests/snapshots/execution_spec__test-merge-batch.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(batch: {delay: 5, headers: ["a", "b", "c"], maxSize: 100}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/snapshots/execution_spec__test-merge-nested.md_merged.snap b/tests/snapshots/execution_spec__test-merge-nested.md_merged.snap deleted file mode 100644 index 781472cc03..0000000000 --- a/tests/snapshots/execution_spec__test-merge-nested.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://abc.com") { - query: Query -} - -type Foo { - """ - test2 - """ - a: String - """ - test1 - """ - b: String -} - -type Query { - hi: Foo @expr(body: {a: "world"}) -} diff --git a/tests/snapshots/execution_spec__test-merge-query.md_merged.snap b/tests/snapshots/execution_spec__test-merge-query.md_merged.snap deleted file mode 100644 index 9e2dc2990a..0000000000 --- a/tests/snapshots/execution_spec__test-merge-query.md_merged.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000) @upstream(baseURL: "http://abc.com", proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") - hi: String @expr(body: "world") -} diff --git a/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_client.snap b/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_client.snap deleted file mode 100644 index ca6c4ff3a0..0000000000 --- a/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -type Foo { - bar: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: Foo -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_merged.snap b/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_merged.snap deleted file mode 100644 index 095502b241..0000000000 --- a/tests/snapshots/execution_spec__test-merge-right-with-link-config.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(allowedHeaders: ["Authorization"]) @link(src: "stripe-types.graphql", type: Config) { - query: Query -} - -type Query { - foo: Foo @expr(body: {bar: "foo"}) -} diff --git a/tests/snapshots/execution_spec__test-merge-server-sdl.md_client.snap b/tests/snapshots/execution_spec__test-merge-server-sdl.md_client.snap deleted file mode 100644 index c1d625a8c9..0000000000 --- a/tests/snapshots/execution_spec__test-merge-server-sdl.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: [User] -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-merge-server-sdl.md_merged.snap b/tests/snapshots/execution_spec__test-merge-server-sdl.md_merged.snap deleted file mode 100644 index 7e75c573bb..0000000000 --- a/tests/snapshots/execution_spec__test-merge-server-sdl.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - foo: [User] @http(path: "/users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-merge-union.md_merged.snap b/tests/snapshots/execution_spec__test-merge-union.md_merged.snap deleted file mode 100644 index 38474eedf0..0000000000 --- a/tests/snapshots/execution_spec__test-merge-union.md_merged.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -union FooBar = Bar | Baz | Foo - -type Bar { - bar: String -} - -type Baz { - baz: String -} - -type Foo { - a: String - foo: String -} - -type Query { - foo: FooBar @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-modify.md_client.snap b/tests/snapshots/execution_spec__test-modify.md_client.snap deleted file mode 100644 index b97d9f3764..0000000000 --- a/tests/snapshots/execution_spec__test-modify.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -input Foo { - bar: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - data(input: Foo): String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-modify.md_merged.snap b/tests/snapshots/execution_spec__test-modify.md_merged.snap deleted file mode 100644 index 501b1177ad..0000000000 --- a/tests/snapshots/execution_spec__test-modify.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -input Foo { - bar: String -} - -type Query { - foo(input: Foo): String @http(path: "/foo") @modify(name: "data") -} diff --git a/tests/snapshots/execution_spec__test-multi-interface.md_client.snap b/tests/snapshots/execution_spec__test-multi-interface.md_client.snap deleted file mode 100644 index 213b5f84eb..0000000000 --- a/tests/snapshots/execution_spec__test-multi-interface.md_client.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B implements IA & IB { - a: String - b: String -} - -scalar Date - -scalar Email - -scalar Empty - -interface IA { - a: String -} - -interface IB { - b: String -} - -scalar JSON - -scalar PhoneNumber - -type Query { - bar: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-multi-interface.md_merged.snap b/tests/snapshots/execution_spec__test-multi-interface.md_merged.snap deleted file mode 100644 index fe90985a1c..0000000000 --- a/tests/snapshots/execution_spec__test-multi-interface.md_merged.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -interface IA { - a: String -} - -interface IB { - b: String -} - -type B implements IA & IB { - a: String - b: String -} - -type Query { - bar: B @http(path: "/user") -} diff --git a/tests/snapshots/execution_spec__test-nested-input.md_client.snap b/tests/snapshots/execution_spec__test-nested-input.md_client.snap deleted file mode 100644 index 32cdd95884..0000000000 --- a/tests/snapshots/execution_spec__test-nested-input.md_client.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -input A { - b: B -} - -input B { - c: C -} - -input C { - d: D -} - -input D { - e: Int -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - a(a: A!): X -} - -scalar Url - -type X { - a: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-nested-input.md_merged.snap b/tests/snapshots/execution_spec__test-nested-input.md_merged.snap deleted file mode 100644 index 83a238a9cf..0000000000 --- a/tests/snapshots/execution_spec__test-nested-input.md_merged.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -input A { - b: B -} - -input B { - c: C -} - -input C { - d: D -} - -input D { - e: Int -} - -type Query { - a(a: A!): X @expr(body: {a: "hello"}) -} - -type X { - a: String -} diff --git a/tests/snapshots/execution_spec__test-nested-link.md_client.snap b/tests/snapshots/execution_spec__test-nested-link.md_client.snap deleted file mode 100644 index 6ecb97cbf0..0000000000 --- a/tests/snapshots/execution_spec__test-nested-link.md_client.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -enum Foo { - BAR - BAZ -} - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int! - user: User - userId: Int! -} - -type Query { - foo: Foo - post(id: Int!): Post -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-nested-link.md_merged.snap b/tests/snapshots/execution_spec__test-nested-link.md_merged.snap deleted file mode 100644 index b7fd3efe85..0000000000 --- a/tests/snapshots/execution_spec__test-nested-link.md_merged.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream @link(src: "graphql-with-link.graphql", type: Config) { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-nested-value.md_client.snap b/tests/snapshots/execution_spec__test-nested-value.md_client.snap deleted file mode 100644 index e7c1878cbe..0000000000 --- a/tests/snapshots/execution_spec__test-nested-value.md_client.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int - user: User! -} - -type Query { - posts: [Post] -} - -scalar Url - -type User { - id: Int! - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-nested-value.md_merged.snap b/tests/snapshots/execution_spec__test-nested-value.md_merged.snap deleted file mode 100644 index e2f70ce7e5..0000000000 --- a/tests/snapshots/execution_spec__test-nested-value.md_merged.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Post { - id: Int - user: User! @http(path: "/users", query: [{key: "id", value: "{{.value.user.id}}"}]) -} - -type Query { - posts: [Post] @http(path: "/posts") -} - -type User { - id: Int! - name: String -} diff --git a/tests/snapshots/execution_spec__test-null-in-array.md_client.snap b/tests/snapshots/execution_spec__test-null-in-array.md_client.snap deleted file mode 100644 index 285311d5cb..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-array.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Company { - id: ID - name: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hi(id: ID!): [Company] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-null-in-array.md_merged.snap b/tests/snapshots/execution_spec__test-null-in-array.md_merged.snap deleted file mode 100644 index 36cf068b16..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-array.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Company { - id: ID - name: String -} - -type Query { - hi(id: ID!): [Company] @http(baseURL: "http://localhost:3000", path: "/hi") -} diff --git a/tests/snapshots/execution_spec__test-null-in-array.md_test_0.snap b/tests/snapshots/execution_spec__test-null-in-array.md_test_0.snap deleted file mode 100644 index 611acae330..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-array.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "hi": null - } - } -} diff --git a/tests/snapshots/execution_spec__test-null-in-object.md_client.snap b/tests/snapshots/execution_spec__test-null-in-object.md_client.snap deleted file mode 100644 index 3cf48f41f5..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-object.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Company { - id: ID - name: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hi(id: ID!): Company -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-null-in-object.md_merged.snap b/tests/snapshots/execution_spec__test-null-in-object.md_merged.snap deleted file mode 100644 index 877f21dbc2..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-object.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Company { - id: ID - name: String -} - -type Query { - hi(id: ID!): Company @http(baseURL: "http://localhost:3000", path: "/hi") -} diff --git a/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap b/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap deleted file mode 100644 index 611acae330..0000000000 --- a/tests/snapshots/execution_spec__test-null-in-object.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "hi": null - } - } -} diff --git a/tests/snapshots/execution_spec__test-omit-list.md_client.snap b/tests/snapshots/execution_spec__test-omit-list.md_client.snap deleted file mode 100644 index 01443ed483..0000000000 --- a/tests/snapshots/execution_spec__test-omit-list.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-omit-list.md_merged.snap b/tests/snapshots/execution_spec__test-omit-list.md_merged.snap deleted file mode 100644 index 7ba329d6e4..0000000000 --- a/tests/snapshots/execution_spec__test-omit-list.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "foo", path: ["foo", "a", "0", "b"]) { - foo: [Foo] @http(path: "/foo") @omit -} diff --git a/tests/snapshots/execution_spec__test-omit.md_client.snap b/tests/snapshots/execution_spec__test-omit.md_client.snap deleted file mode 100644 index 01443ed483..0000000000 --- a/tests/snapshots/execution_spec__test-omit.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type B { - c: String -} - -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: B -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-omit.md_merged.snap b/tests/snapshots/execution_spec__test-omit.md_merged.snap deleted file mode 100644 index f15e34f235..0000000000 --- a/tests/snapshots/execution_spec__test-omit.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type A { - b: B -} - -type B { - c: String -} - -type Foo { - a: A -} - -type Query @addField(name: "foo", path: ["foo", "a", "b"]) { - foo: Foo @http(path: "/foo") @omit -} diff --git a/tests/snapshots/execution_spec__test-params-as-body.md_client.snap b/tests/snapshots/execution_spec__test-params-as-body.md_client.snap deleted file mode 100644 index c1991a68eb..0000000000 --- a/tests/snapshots/execution_spec__test-params-as-body.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser(id: Int, name: String): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-params-as-body.md_merged.snap b/tests/snapshots/execution_spec__test-params-as-body.md_merged.snap deleted file mode 100644 index fdd1b67bac..0000000000 --- a/tests/snapshots/execution_spec__test-params-as-body.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - firstUser(id: Int, name: String): User @http(body: "{{.args}}", method: "POST", path: "/users") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-params-as-body.md_test_0.snap b/tests/snapshots/execution_spec__test-params-as-body.md_test_0.snap deleted file mode 100644 index 2a22411572..0000000000 --- a/tests/snapshots/execution_spec__test-params-as-body.md_test_0.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "id": 1, - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-query-documentation.md_client.snap b/tests/snapshots/execution_spec__test-query-documentation.md_client.snap deleted file mode 100644 index 1516100009..0000000000 --- a/tests/snapshots/execution_spec__test-query-documentation.md_client.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - """ - This is test - """ - foo: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-query-documentation.md_merged.snap b/tests/snapshots/execution_spec__test-query-documentation.md_merged.snap deleted file mode 100644 index ecbc0275e9..0000000000 --- a/tests/snapshots/execution_spec__test-query-documentation.md_merged.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - """ - This is test - """ - foo: String @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-query.md_client.snap b/tests/snapshots/execution_spec__test-query.md_client.snap deleted file mode 100644 index 98032c71c4..0000000000 --- a/tests/snapshots/execution_spec__test-query.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-query.md_merged.snap b/tests/snapshots/execution_spec__test-query.md_merged.snap deleted file mode 100644 index a6285a3b09..0000000000 --- a/tests/snapshots/execution_spec__test-query.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - foo: String @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-ref-other.md_client.snap b/tests/snapshots/execution_spec__test-ref-other.md_client.snap deleted file mode 100644 index 848d82384b..0000000000 --- a/tests/snapshots/execution_spec__test-ref-other.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -type InPost { - get: [Post] -} - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int! - userId: Int! -} - -type Query { - posts: InPost -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-ref-other.md_merged.snap b/tests/snapshots/execution_spec__test-ref-other.md_merged.snap deleted file mode 100644 index 6ae6460ed4..0000000000 --- a/tests/snapshots/execution_spec__test-ref-other.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type InPost { - get: [Post] @http(path: "/posts") -} - -type Post { - id: Int! - userId: Int! -} - -type Query { - posts: InPost -} diff --git a/tests/snapshots/execution_spec__test-response-header-merge.md_merged.snap b/tests/snapshots/execution_spec__test-response-header-merge.md_merged.snap deleted file mode 100644 index 7645fea9ce..0000000000 --- a/tests/snapshots/execution_spec__test-response-header-merge.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {custom: [{key: "a", value: "a"}, {key: "a", value: "b"}]}) @upstream { - query: Query -} - -type Query { - user: User @expr(body: {name: "John"}) -} - -type User { - age: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_client.snap b/tests/snapshots/execution_spec__test-scalars.md_client.snap deleted file mode 100644 index 8e71d5cb24..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_client.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - date(value: Date!): Date! - email(value: Email!): Email! - phone(value: PhoneNumber!): PhoneNumber! - url(value: Url!): Url! -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_merged.snap b/tests/snapshots/execution_spec__test-scalars.md_merged.snap deleted file mode 100644 index 0c1d7d83a1..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_merged.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(graphiql: true, hostname: "localhost", port: 8000) @upstream { - query: Query -} - -scalar Date - -scalar Email - -scalar PhoneNumber - -scalar Url - -type Query { - date(value: Date!): Date! @expr(body: "{{.args.value}}") - email(value: Email!): Email! @expr(body: "{{.args.value}}") - phone(value: PhoneNumber!): PhoneNumber! @expr(body: "{{.args.value}}") - url(value: Url!): Url! @expr(body: "{{.args.value}}") -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_0.snap b/tests/snapshots/execution_spec__test-scalars.md_test_0.snap deleted file mode 100644 index 2b6b008df5..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_0.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "email": "alo@valid.com" - } - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_1.snap b/tests/snapshots/execution_spec__test-scalars.md_test_1.snap deleted file mode 100644 index b1a613afcf..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_1.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "phone": "+1 (614) 1234567" - } - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_2.snap b/tests/snapshots/execution_spec__test-scalars.md_test_2.snap deleted file mode 100644 index e4afce338b..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_2.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "date": "2023-03-08T12:45:26-05:00" - } - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_3.snap b/tests/snapshots/execution_spec__test-scalars.md_test_3.snap deleted file mode 100644 index 372f6a74b0..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_3.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "url": "https://tailcall.run/" - } - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_4.snap b/tests/snapshots/execution_spec__test-scalars.md_test_4.snap deleted file mode 100644 index a59ad47ddc..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_4.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"Email\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "email" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_5.snap b/tests/snapshots/execution_spec__test-scalars.md_test_5.snap deleted file mode 100644 index b8191a4710..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_5.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "phone" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_6.snap b/tests/snapshots/execution_spec__test-scalars.md_test_6.snap deleted file mode 100644 index b8191a4710..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_6.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"PhoneNumber\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "phone" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_7.snap b/tests/snapshots/execution_spec__test-scalars.md_test_7.snap deleted file mode 100644 index 63f505d5ad..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_7.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"Date\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "date" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-scalars.md_test_8.snap b/tests/snapshots/execution_spec__test-scalars.md_test_8.snap deleted file mode 100644 index 064486f525..0000000000 --- a/tests/snapshots/execution_spec__test-scalars.md_test_8.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "internal: invalid value for scalar \"Url\", expected \"FieldValue::Value\"", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "url" - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__test-server-base-types.md_merged.snap b/tests/snapshots/execution_spec__test-server-base-types.md_merged.snap deleted file mode 100644 index bf786889b4..0000000000 --- a/tests/snapshots/execution_spec__test-server-base-types.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(port: 8000) @upstream(baseURL: "http://abc.com", proxy: {url: "http://localhost:3000"}) { - query: Query -} - -type Query { - hello: String @expr(body: "world") -} diff --git a/tests/snapshots/execution_spec__test-server-vars.md_client.snap b/tests/snapshots/execution_spec__test-server-vars.md_client.snap deleted file mode 100644 index 98032c71c4..0000000000 --- a/tests/snapshots/execution_spec__test-server-vars.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-server-vars.md_merged.snap b/tests/snapshots/execution_spec__test-server-vars.md_merged.snap deleted file mode 100644 index cc35cd7bd6..0000000000 --- a/tests/snapshots/execution_spec__test-server-vars.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(vars: [{key: "foo", value: "bar"}]) @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type Query { - foo: String @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-set-cookie-headers.md_client.snap b/tests/snapshots/execution_spec__test-set-cookie-headers.md_client.snap deleted file mode 100644 index ea1bbf5089..0000000000 --- a/tests/snapshots/execution_spec__test-set-cookie-headers.md_client.snap +++ /dev/null @@ -1,32 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-set-cookie-headers.md_merged.snap b/tests/snapshots/execution_spec__test-set-cookie-headers.md_merged.snap deleted file mode 100644 index b97ade4116..0000000000 --- a/tests/snapshots/execution_spec__test-set-cookie-headers.md_merged.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server(headers: {setCookies: true}, graphiql: true, hostname: "0.0.0.0", port: 8080) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - user(id: Int!): User @http(path: "/users/{{.args.id}}") -} - -type User { - email: String! - id: Int! - name: String! - phone: String - username: String! - website: String -} diff --git a/tests/snapshots/execution_spec__test-set-cookie-headers.md_test_0.snap b/tests/snapshots/execution_spec__test-set-cookie-headers.md_test_0.snap deleted file mode 100644 index 9d0f9afeec..0000000000 --- a/tests/snapshots/execution_spec__test-set-cookie-headers.md_test_0.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json", - "set-cookie": "user=1; user=2" - }, - "body": { - "data": { - "u1": { - "name": "foo" - }, - "u2": { - "name": "bar" - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-static-value.md_client.snap b/tests/snapshots/execution_spec__test-static-value.md_client.snap deleted file mode 100644 index 2ae445a996..0000000000 --- a/tests/snapshots/execution_spec__test-static-value.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - firstUser: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-static-value.md_merged.snap b/tests/snapshots/execution_spec__test-static-value.md_merged.snap deleted file mode 100644 index 3ff90146b1..0000000000 --- a/tests/snapshots/execution_spec__test-static-value.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - firstUser: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__test-static-value.md_test_0.snap b/tests/snapshots/execution_spec__test-static-value.md_test_0.snap deleted file mode 100644 index 0204fa30dc..0000000000 --- a/tests/snapshots/execution_spec__test-static-value.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "firstUser": { - "name": "Leanne Graham" - } - } - } -} diff --git a/tests/snapshots/execution_spec__test-tag.md_client.snap b/tests/snapshots/execution_spec__test-tag.md_client.snap deleted file mode 100644 index c2704ce434..0000000000 --- a/tests/snapshots/execution_spec__test-tag.md_client.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -type NEWS { - getAllNews: News__NewsList! -} - -type News__News { - body: String - id: Int - postImage: String - title: String -} - -type News__NewsList { - news: [News__News] -} - -scalar PhoneNumber - -type Query { - news: NEWS -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-tag.md_merged.snap b/tests/snapshots/execution_spec__test-tag.md_merged.snap deleted file mode 100644 index 6cd46d4019..0000000000 --- a/tests/snapshots/execution_spec__test-tag.md_merged.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -type NEWS { - getAllNews: News__NewsList! -} - -type News__News @tag(id: "news.News") { - body: String @expr(body: "This is a news body") - id: Int @expr(body: 1) - postImage: String @expr(body: "http://example.com/image.jpg") - title: String @expr(body: "This is a news title") -} - -type News__NewsList @tag(id: "news.NewsList") { - news: [News__News] -} - -type Query { - news: NEWS -} diff --git a/tests/snapshots/execution_spec__test-union.md_client.snap b/tests/snapshots/execution_spec__test-union.md_client.snap deleted file mode 100644 index e9e1e630b0..0000000000 --- a/tests/snapshots/execution_spec__test-union.md_client.snap +++ /dev/null @@ -1,33 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -type Bar { - bar: String -} - -scalar Date - -scalar Email - -scalar Empty - -type Foo { - foo: String -} - -union FooBar = Bar | Foo - -scalar JSON - -scalar PhoneNumber - -type Query { - foo: FooBar -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-union.md_merged.snap b/tests/snapshots/execution_spec__test-union.md_merged.snap deleted file mode 100644 index 2973f0c44f..0000000000 --- a/tests/snapshots/execution_spec__test-union.md_merged.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplacheholder.typicode.com") { - query: Query -} - -scalar Baz - -union FooBar = Bar | Foo - -type Bar { - bar: String -} - -type Foo { - foo: String -} - -type Query { - foo: FooBar @http(path: "/foo") -} diff --git a/tests/snapshots/execution_spec__test-upstream-headers.md_client.snap b/tests/snapshots/execution_spec__test-upstream-headers.md_client.snap deleted file mode 100644 index ef9095a633..0000000000 --- a/tests/snapshots/execution_spec__test-upstream-headers.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - id: Int -} - -type Query { - posts: [Post] -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-upstream-headers.md_merged.snap b/tests/snapshots/execution_spec__test-upstream-headers.md_merged.snap deleted file mode 100644 index 41a9495bfe..0000000000 --- a/tests/snapshots/execution_spec__test-upstream-headers.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(allowedHeaders: ["X-bar", "x-foo"], baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Post { - id: Int -} - -type Query { - posts: [Post] @http(path: "/posts") -} diff --git a/tests/snapshots/execution_spec__test-upstream-headers.md_test_0.snap b/tests/snapshots/execution_spec__test-upstream-headers.md_test_0.snap deleted file mode 100644 index 3042345c09..0000000000 --- a/tests/snapshots/execution_spec__test-upstream-headers.md_test_0.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "posts": [ - { - "id": 11 - }, - { - "id": 3 - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__test-upstream.md_client.snap b/tests/snapshots/execution_spec__test-upstream.md_client.snap deleted file mode 100644 index 60f26910ce..0000000000 --- a/tests/snapshots/execution_spec__test-upstream.md_client.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - hello: String -} - -scalar Url - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__test-upstream.md_merged.snap b/tests/snapshots/execution_spec__test-upstream.md_merged.snap deleted file mode 100644 index e4413038b9..0000000000 --- a/tests/snapshots/execution_spec__test-upstream.md_merged.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(proxy: {url: "http://localhost:8085"}) { - query: Query -} - -type Query { - hello: String @http(baseURL: "http://localhost:8000", path: "/hello") -} diff --git a/tests/snapshots/execution_spec__upstream-batching.md_client.snap b/tests/snapshots/execution_spec__upstream-batching.md_client.snap deleted file mode 100644 index 89319b393a..0000000000 --- a/tests/snapshots/execution_spec__upstream-batching.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__upstream-batching.md_merged.snap b/tests/snapshots/execution_spec__upstream-batching.md_merged.snap deleted file mode 100644 index 5aa162b29f..0000000000 --- a/tests/snapshots/execution_spec__upstream-batching.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { - query: Query -} - -type Query { - user(id: Int): User @http(baseURL: "http://jsonplaceholder.typicode.com", batchKey: ["id"], path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__upstream-batching.md_test_0.snap b/tests/snapshots/execution_spec__upstream-batching.md_test_0.snap deleted file mode 100644 index c1db4d440d..0000000000 --- a/tests/snapshots/execution_spec__upstream-batching.md_test_0.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "u1": { - "id": 1 - }, - "u2": { - "id": 2 - } - } - } -} diff --git a/tests/snapshots/execution_spec__upstream-fail-request.md_client.snap b/tests/snapshots/execution_spec__upstream-fail-request.md_client.snap deleted file mode 100644 index 84d2907e22..0000000000 --- a/tests/snapshots/execution_spec__upstream-fail-request.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user: User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__upstream-fail-request.md_merged.snap b/tests/snapshots/execution_spec__upstream-fail-request.md_merged.snap deleted file mode 100644 index 822924f58f..0000000000 --- a/tests/snapshots/execution_spec__upstream-fail-request.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__upstream-fail-request.md_test_0.snap b/tests/snapshots/execution_spec__upstream-fail-request.md_test_0.snap deleted file mode 100644 index 0973768ee0..0000000000 --- a/tests/snapshots/execution_spec__upstream-fail-request.md_test_0.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": null, - "errors": [ - { - "message": "IOException: Status code error", - "locations": [ - { - "line": 1, - "column": 9 - } - ] - } - ] - } -} diff --git a/tests/snapshots/execution_spec__with-args-url.md_client.snap b/tests/snapshots/execution_spec__with-args-url.md_client.snap deleted file mode 100644 index 33012a438b..0000000000 --- a/tests/snapshots/execution_spec__with-args-url.md_client.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): User -} - -scalar Url - -type User { - id: Int - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__with-args-url.md_merged.snap b/tests/snapshots/execution_spec__with-args-url.md_merged.snap deleted file mode 100644 index 44df311d08..0000000000 --- a/tests/snapshots/execution_spec__with-args-url.md_merged.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Query { - user(id: Int!): User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/{{.args.id}}") -} - -type User { - id: Int - name: String -} diff --git a/tests/snapshots/execution_spec__with-args-url.md_test_0.snap b/tests/snapshots/execution_spec__with-args-url.md_test_0.snap deleted file mode 100644 index c1d6f66212..0000000000 --- a/tests/snapshots/execution_spec__with-args-url.md_test_0.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "name": "foo" - } - } - } -} diff --git a/tests/snapshots/execution_spec__with-args.md_client.snap b/tests/snapshots/execution_spec__with-args.md_client.snap deleted file mode 100644 index 3842039749..0000000000 --- a/tests/snapshots/execution_spec__with-args.md_client.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Query { - user(id: Int!): [User] -} - -scalar Url - -type User { - name: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__with-args.md_merged.snap b/tests/snapshots/execution_spec__with-args.md_merged.snap deleted file mode 100644 index 4b29d398a0..0000000000 --- a/tests/snapshots/execution_spec__with-args.md_merged.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream { - query: Query -} - -type Query { - user(id: Int!): [User] @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users", query: [{key: "id", value: "{{.args.id}}"}]) -} - -type User { - name: String -} diff --git a/tests/snapshots/execution_spec__with-args.md_test_0.snap b/tests/snapshots/execution_spec__with-args.md_test_0.snap deleted file mode 100644 index 9e1032ec3c..0000000000 --- a/tests/snapshots/execution_spec__with-args.md_test_0.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": [ - { - "name": "Leanne Graham" - } - ] - } - } -} diff --git a/tests/snapshots/execution_spec__with-nesting.md_client.snap b/tests/snapshots/execution_spec__with-nesting.md_client.snap deleted file mode 100644 index b7c8c5e8bc..0000000000 --- a/tests/snapshots/execution_spec__with-nesting.md_client.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: client ---- -scalar Date - -scalar Email - -scalar Empty - -scalar JSON - -scalar PhoneNumber - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Query { - user: User -} - -scalar Url - -type User { - email: String! - id: Int! - name: String! - phone: String - posts: [Post] - username: String! - website: String -} - -schema { - query: Query -} diff --git a/tests/snapshots/execution_spec__with-nesting.md_merged.snap b/tests/snapshots/execution_spec__with-nesting.md_merged.snap deleted file mode 100644 index 99a69a6c1c..0000000000 --- a/tests/snapshots/execution_spec__with-nesting.md_merged.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: merged ---- -schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { - query: Query -} - -type Post { - body: String - id: Int - title: String - userId: Int -} - -type Query { - user: User @http(path: "/users/1") -} - -type User { - email: String! - id: Int! - name: String! - phone: String - posts: [Post] @http(path: "/users/{{.value.id}}/posts") - username: String! - website: String -} diff --git a/tests/snapshots/execution_spec__with-nesting.md_test_0.snap b/tests/snapshots/execution_spec__with-nesting.md_test_0.snap deleted file mode 100644 index e99fb28e7e..0000000000 --- a/tests/snapshots/execution_spec__with-nesting.md_test_0.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/execution_spec.rs -expression: response ---- -{ - "status": 200, - "headers": { - "content-type": "application/json" - }, - "body": { - "data": { - "user": { - "posts": [ - { - "title": "title1" - }, - { - "title": "title2" - }, - { - "title": "title3" - } - ] - } - } - } -}