{"record":{"id":"c2259e03ea40239d","repo":"facebook/relay","slug":"query-exists","errorCode":null,"errorMessage":"Query exists","messagePattern":"Query exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-transforms/src/generate_typename.rs","lineNumber":326,"sourceCode":"    /// cache: when the same `Arc<InlineFragment>` reaches `transform_inline_fragment`\n    /// from multiple parallel operation traversals, every caller must receive the\n    /// SAME output `Arc<InlineFragment>`. Downstream `PointerAddress`-keyed caches\n    /// in `flatten` and `skip_redundant_nodes` rely on this identity. A per-call\n    /// cache (which silently breaks identity) passes every fixture test but\n    /// regresses end-to-end build wall by inflating downstream cache misses.\n    #[test]\n    fn shared_cache_preserves_arc_identity_across_operations() {\n        let schema = Arc::new(\n            schema::build_schema(\n                \"interface Node { id: ID }\n                 type User implements Node { id: ID, name: String }\n                 type Query { node: Node }\",\n            )\n            .unwrap(),\n        );\n        let node_type = schema.get_type(\"Node\".intern()).expect(\"Node exists\");\n        assert!(node_type.is_abstract_type(), \"Node must be abstract\");\n        let query_type = schema.query_type().expect(\"Query exists\");\n\n        // Construct ONE Arc<InlineFragment> shared across multiple operations.\n        // Empty selections + abstract type_condition force `transform_inline_fragment`\n        // down the Replace path (it injects __isNode), so the cache stores a fresh\n        // Arc whose identity we can compare across callers.\n        let shared_inline = Arc::new(InlineFragment {\n            type_condition: Some(node_type),\n            directives: vec![],\n            selections: vec![],\n            spread_location: Location::generated(),\n        });\n\n        let make_op = |name: &str| {\n            Arc::new(OperationDefinition {\n                kind: OperationKind::Query,\n                name: WithLocation::generated(OperationDefinitionName(name.intern())),\n                type_: query_type,\n                variable_definitions: vec![],","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-transforms/src/generate_typename.rs#L308-L344","documentation":"Test assertion in shared_cache_preserves_arc_identity_across_operations confirming the queried operation exists in the compiled program. It fires when the test fixture's GraphQL document failed to compile into the expected operation, not from production relay-transforms logic.","triggerScenarios":"Thrown at compiler/crates/relay-transforms/src/generate_typename.rs:326 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the test document's operation name matches the name used in the program lookup","Check that the test schema fixture and operation text are well-formed and compile without errors"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}