{"record":{"id":"2e858f5870d10c33","repo":"facebook/relay","slug":"cannot-print-empty-selections-for-name-please","errorCode":null,"errorMessage":"Cannot print empty selections for {name}. Please, check transforms that may produce invalid selections.","messagePattern":"Cannot print empty selections for (.+?)\\. Please, check transforms that may produce invalid selections\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/graphql-text-printer/src/print_to_text.rs","lineNumber":268,"sourceCode":"        let len = selections.len();\n        if len > 0 {\n            self.print_optional_space()?;\n            write!(self.writer, \"{{\")?;\n            self.indentation += 1;\n            self.print_new_line(true)?;\n\n            for (i, selection) in selections.iter().enumerate() {\n                self.print_selection(selection, None)?;\n                if i != len - 1 {\n                    self.print_item_separator()?;\n                }\n            }\n\n            self.indentation -= 1;\n            self.print_new_line(true)?;\n            write!(self.writer, \"}}\")?;\n        } else {\n            panic!(\n                \"Cannot print empty selections for {name}. Please, check transforms that may produce invalid selections.\"\n            );\n        }\n        Ok(())\n    }\n\n    fn print_selection(\n        &mut self,\n        selection: &Selection,\n        conditions: Option<Vec<&Condition>>,\n    ) -> FmtResult {\n        match selection {\n            Selection::ScalarField(field) => self.print_scalar_field(field, conditions),\n            Selection::LinkedField(field) => self.print_linked_field(field, conditions),\n            Selection::FragmentSpread(field) => self.print_fragment_spread(field, conditions),\n            Selection::InlineFragment(field) => self.print_inline_fragment(field, conditions),\n            Selection::Condition(field) => self.print_condition(field, conditions),\n        }","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/graphql-text-printer/src/print_to_text.rs#L250-L286","documentation":"Panic in print_selections while serializing an operation or fragment to GraphQL text: the selection set is empty after printing began. The text printer cannot emit a valid selection set with zero fields, so a transform upstream produced an invalid definition (e.g. a fragment left with all fields stripped). The message names the definition to inspect.","triggerScenarios":"Thrown at compiler/crates/graphql-text-printer/src/print_to_text.rs:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Identify which transform runs before printing removed all selections from the named definition","Guard custom transforms to skip or prune definitions that would end up with empty selection sets","Ensure @include/@skip directives don't statically remove every field of a fragment"],"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"}