{"record":{"id":"612568ed85c62488","repo":"facebook/relay","slug":"user-id-exists","errorCode":null,"errorMessage":"User.id exists","messagePattern":"User\\.id exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/schema-set/src/build_in_memory_schema.rs","lineNumber":758,"sourceCode":"    }\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() {\n        let sdl = \"type Query { name: String }\";\n        let source = SourceLocationKey::standalone(\"q.graphql\");\n        let schema = build_in_memory_schema(&schema_set_from(sdl, source)).unwrap();\n\n        // `String` is implicit in the SDL but must exist in the built schema.\n        assert!(schema.get_type(\"String\".intern()).is_some());\n        // `load_defaults` ran: __typename is queryable.","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/schema-set/src/build_in_memory_schema.rs#L740-L776","documentation":"Test assertion in preserves_source_locations: the User object must expose an id field. Firing means field lookup on the built object failed, pointing at a regression in field storage or naming during the in-memory schema build.","triggerScenarios":"Thrown at compiler/crates/schema-set/src/build_in_memory_schema.rs:758 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the fixture SDL still declares id on User","Inspect field registration in build_in_memory_schema"],"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"}