diff --git a/compiler/crates/relay-typegen/src/visit.rs b/compiler/crates/relay-typegen/src/visit.rs index bf0978b0b1daa..ebf712c115d89 100644 --- a/compiler/crates/relay-typegen/src/visit.rs +++ b/compiler/crates/relay-typegen/src/visit.rs @@ -2324,10 +2324,7 @@ pub(crate) fn raw_response_visit_selections( runtime_imports, custom_scalars, enclosing_linked_field_concrete_type, - inline_fragment - .directives - .named(*THROW_ON_FIELD_ERROR_DIRECTIVE) - .is_some(), + emit_semantic_types, ), Selection::LinkedField(linked_field) => { // Note: We intentionally use the semantic field type here diff --git a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/semantic_non_null_in_raw_response.expected b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/semantic_non_null_in_raw_response.expected index 096130def163f..d32afeedb6262 100644 --- a/compiler/crates/relay-typegen/tests/generate_flow/fixtures/semantic_non_null_in_raw_response.expected +++ b/compiler/crates/relay-typegen/tests/generate_flow/fixtures/semantic_non_null_in_raw_response.expected @@ -29,14 +29,14 @@ export type MyQuery$data = {| |}; export type MyQuery$rawResponse = {| +opera?: ?{| - +cast: ?$ReadOnlyArray, - +composer: ?{| + +composer: {| +id: string, +name: ?string, |}, diff --git a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/semantic_non_null_in_raw_response.expected b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/semantic_non_null_in_raw_response.expected index d531b42780369..5fdb7656ddce5 100644 --- a/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/semantic_non_null_in_raw_response.expected +++ b/compiler/crates/relay-typegen/tests/generate_typescript/fixtures/semantic_non_null_in_raw_response.expected @@ -30,16 +30,16 @@ export type MyQuery$data = { export type MyQuery$rawResponse = { readonly opera?: { readonly cast: ReadonlyArray<{ - readonly character: string | null | undefined; + readonly character: string; readonly singer: { readonly id: string; readonly name: string | null | undefined; - } | null | undefined; - } | null | undefined> | null | undefined; + }; + }>; readonly composer: { readonly id: string; readonly name: string | null | undefined; - } | null | undefined; + }; } | null | undefined; }; export type MyQuery = {