{"record":{"id":"2ab3e43d236e0393","repo":"facebook/relay","slug":"expected-to-get-selection-type","errorCode":null,"errorMessage":"Expected to get selection type.","messagePattern":"Expected to get selection type\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/resolution-path/src/selection_parent_type.rs","lineNumber":170,"sourceCode":"            ResolutionPath::Ident(IdentPath {\n                inner: _,\n                parent:\n                    IdentParent::LinkedFieldName(LinkedFieldPath {\n                        inner: _,\n                        parent: selection,\n                    }),\n            }) => selection.parent.find_parent_type(&schema),\n            ResolutionPath::Ident(IdentPath {\n                inner: _,\n                parent:\n                    IdentParent::ScalarFieldName(ScalarFieldPath {\n                        inner: _,\n                        parent: selection,\n                    }),\n            }) => selection.parent.find_parent_type(&schema),\n            _ => None,\n        }\n        .expect(\"Expected to get selection type.\");\n\n        schema.get_type_name(selection_type)\n    }\n\n    #[test]\n    fn test_me() {\n        let source = r#\"\n        query Foo {\n            me {\n                id\n                ... {\n                    name\n                }\n                emailAddresses\n                screennames {\n                    service\n                }\n                author {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/resolution-path/src/selection_parent_type.rs#L152-L188","documentation":"Guard in get_field_parent_type_name: walking a resolution path from a linked/scalar field selection to its parent selection must resolve to a concrete schema type. Firing means the parent type lookup (find_parent_type) returned None, typically because the selection references a type absent from the schema set or the resolution path was built against a different schema.","triggerScenarios":"Thrown at compiler/crates/resolution-path/src/selection_parent_type.rs:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the referenced parent type exists in the schema set used to build the resolution path","Check that resolution paths are not reused across different schemas","Return a diagnostic error instead of unwrap when the parent type is missing"],"exampleFix":null,"handlingStrategy":"validation","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"}