{"record":{"id":"517bf2186b05d76a","repo":"facebook/relay","slug":"user-type-exists","errorCode":null,"errorMessage":"User type exists","messagePattern":"User type exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/schema-set/src/build_in_memory_schema.rs","lineNumber":750,"sourceCode":"        base_source: SourceLocationKey,\n        extension_sdl: &str,\n        extension_source: SourceLocationKey,\n    ) -> DiagnosticsResult<SchemaSet> {\n        SchemaSet::from_schema_documents_with_extensions(\n            &[parse_schema_document(base_sdl, base_source).unwrap()],\n            &[parse_schema_document(extension_sdl, extension_source).unwrap()],\n        )\n    }\n\n    #[test]\n    fn preserves_source_locations() {\n        let sdl = \"type Query { me: User }\\n\\ntype User { id: ID name: String }\";\n        let source = SourceLocationKey::standalone(\"user.graphql\");\n        let schema = build_in_memory_schema(&schema_set_from(sdl, source)).unwrap();\n\n        // The `User` type's name points back at the original source file, not a\n        // generated location — this is the whole purpose of the direct build.\n        let user_type = schema.get_type(\"User\".intern()).expect(\"User type exists\");\n        let user = schema.object(user_type.get_object_id().expect(\"User is an object\"));\n        assert_eq!(user.name.location.source_location(), source);\n        assert_ne!(user.name.location, Location::generated());\n\n        // Field locations are preserved too.\n        let id_field_id = schema\n            .named_field(user_type, \"id\".intern())\n            .expect(\"User.id exists\");\n        let id_field = schema.field(id_field_id);\n        assert_eq!(id_field.name.location.source_location(), source);\n        assert_ne!(id_field.name.location, Location::generated());\n\n        // Sanity: the schema is structurally usable (root + resolved field type).\n        assert!(schema.query_type().is_some());\n        assert!(matches!(id_field.type_, schema::TypeReference::Named(_)));\n    }\n\n    #[test]","sourceCodeStart":732,"sourceCodeEnd":768,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/schema-set/src/build_in_memory_schema.rs#L732-L768","documentation":"Test assertion in preserves_source_locations: schema.get_type(\"User\") must succeed because the fixture SDL defines type User. Firing in this test context means the in-memory schema build dropped a type, indicating a build_in_memory_schema regression rather than production behavior.","triggerScenarios":"Thrown at compiler/crates/schema-set/src/build_in_memory_schema.rs:750 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the fixture SDL still defines the User type","Debug build_in_memory_schema for dropped type definitions","Ensure parse_schema_document succeeded on the fixture"],"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"}