diff --git a/.envrc b/.envrc index d75750f1c7cf..d2e4c1b0ca92 100644 --- a/.envrc +++ b/.envrc @@ -7,7 +7,6 @@ export RUST_LOG=info export PRISMA_DML_PATH=$(pwd)/dev_datamodel.prisma export PRISMA2_BINARY_PATH="/usr/local/lib/node_modules/prisma2/" export PRISMA_BINARY_PATH=$(pwd)/target/release/query-engine -export PRISMA_ENGINE_PROTOCOL="graphql" ### QE config vars, set to testing values ### export SQLITE_MAX_VARIABLE_NUMBER=250000 # This must be in sync with the setting in the engineer build CLI diff --git a/Makefile b/Makefile index dc57f350d750..82f3a81147ab 100644 --- a/Makefile +++ b/Makefile @@ -360,7 +360,10 @@ validate: cargo run --bin test-cli -- validate-datamodel dev_datamodel.prisma qe: - cargo run --bin query-engine -- --enable-playground --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response + cargo run --bin query-engine -- --engine-protocol json --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response + +qe-graphql: + cargo run --bin query-engine -- --engine-protocol graphql --enable-playground --enable-raw-queries --enable-metrics --enable-open-telemetry --enable-telemetry-in-response qe-dmmf: cargo run --bin query-engine -- cli dmmf > dmmf.json diff --git a/query-engine/black-box-tests/tests/protocols/mismatched.rs b/query-engine/black-box-tests/tests/protocols/mismatched.rs index fe1060e038a3..7bd9969f51f3 100644 --- a/query-engine/black-box-tests/tests/protocols/mismatched.rs +++ b/query-engine/black-box-tests/tests/protocols/mismatched.rs @@ -63,7 +63,7 @@ mod mismatched { .unwrap(); assert_eq!(res.status(), reqwest::StatusCode::UNPROCESSABLE_ENTITY); - insta::assert_snapshot!(res.text().await.unwrap(), @r###"{"is_panic":false,"message":"Error parsing Json query. data did not match any variant of untagged enum JsonBody","backtrace":null}"###); + insta::assert_snapshot!(res.text().await.unwrap(), @r###"{"is_panic":false,"message":"Error parsing Json query. Ensure that engine protocol of the client and the engine matches. data did not match any variant of untagged enum JsonBody","backtrace":null}"###); }) .await } @@ -83,7 +83,7 @@ mod mismatched { .unwrap(); assert_eq!(res.status(), reqwest::StatusCode::UNPROCESSABLE_ENTITY); - insta::assert_snapshot!(res.text().await.unwrap(), @r###"{"is_panic":false,"message":"Error parsing Graphql query. data did not match any variant of untagged enum GraphqlBody","backtrace":null}"###); + insta::assert_snapshot!(res.text().await.unwrap(), @r###"{"is_panic":false,"message":"Error parsing Graphql query. Ensure that engine protocol of the client and the engine matches. data did not match any variant of untagged enum GraphqlBody","backtrace":null}"###); }) .await } diff --git a/query-engine/query-engine/src/server/mod.rs b/query-engine/query-engine/src/server/mod.rs index f3583df310d7..01b61a07b6b4 100644 --- a/query-engine/query-engine/src/server/mod.rs +++ b/query-engine/query-engine/src/server/mod.rs @@ -189,7 +189,7 @@ async fn request_handler(cx: Arc, req: Request) -> Result { let ufe: user_facing_errors::Error = request_handlers::HandlerError::query_conversion(format!( - "Error parsing {:?} query. {}", + "Error parsing {:?} query. Ensure that engine protocol of the client and the engine matches. {}", cx.engine_protocol(), e ))