{"record":{"id":"8ac31df12815e177","repo":"facebook/relay","slug":"user-is-an-object","errorCode":null,"errorMessage":"User is an object","messagePattern":"User is an object","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/schema-set/src/build_in_memory_schema.rs","lineNumber":751,"sourceCode":"        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]\n    fn resolves_builtin_scalars_and_defaults() {","sourceCodeStart":733,"sourceCodeEnd":769,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/schema-set/src/build_in_memory_schema.rs#L733-L769","documentation":"Test assertion in preserves_source_locations: get_object_id on the User type must succeed, i.e. User must be an object type. Firing means User resolved to a non-object kind (interface/union/scalar) or the object id lookup failed in the in-memory schema build.","triggerScenarios":"Thrown at compiler/crates/schema-set/src/build_in_memory_schema.rs:751 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the fixture defines User as an object type","Check SchemaData object id resolution for the built schema"],"exampleFix":null,"handlingStrategy":"type-guard","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"}