facebook/relay · error

Node exists

Error message

Node exists

What it means

Test assertion in sorts_arguments_interfaces_and_directives_alphabetically: schema.get_type("Node") must succeed since the fixture SDL defines the Node object. Firing means the in-memory schema build dropped the type, signaling a build regression exposed by this ordering test.

Source

Thrown at compiler/crates/schema-set/src/build_in_memory_schema.rs:816

        // here in non-alphabetical order. The built schema must return them
        // alphabetically so its ordering is independent of input read order (a
        // flatbuffer schema is always fully sorted, and callsites moving off it
        // must not see ordering churn).
        let sdl = "\
directive @zed on OBJECT | FIELD_DEFINITION
directive @abc on OBJECT | FIELD_DEFINITION
interface Zeta { id: ID }
interface Alpha { id: ID }
interface Mango { id: ID }
type Node implements Zeta & Alpha & Mango @zed @abc {
  id: ID
  search(zebra: Int, alpha: Int, mango: Int): String @zed @abc
}
type Query { node: Node }";
        let source = SourceLocationKey::standalone("app.graphql");
        let schema = build_in_memory_schema(&schema_set_from(sdl, source)).unwrap();

        let node_type = schema.get_type("Node".intern()).expect("Node exists");
        let node = schema.object(node_type.get_object_id().expect("Node is an object"));

        // Implemented interfaces resolve in alphabetical name order.
        let interface_names: Vec<String> = node
            .interfaces
            .iter()
            .map(|id| schema.interface(*id).name.item.to_string())
            .collect();
        assert_eq!(interface_names, vec!["Alpha", "Mango", "Zeta"]);

        // Directives applied to the type are sorted by name.
        let type_directives: Vec<String> =
            node.directives.iter().map(|d| d.name.to_string()).collect();
        assert_eq!(type_directives, vec!["abc", "zed"]);

        let search = schema.field(
            schema
                .named_field(node_type, "search".intern())

View on GitHub (pinned to 668b1b85e0)

Solutions

  1. Verify the fixture SDL string still defines the Node type
  2. Debug type registration in build_in_memory_schema for multi-interface objects
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at compiler/crates/schema-set/src/build_in_memory_schema.rs:816 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of facebook/relay@668b1b85e0 (2026-09-02). Data as JSON: /api/errors/4338131fca8d5984. Report an issue: GitHub.