{"record":{"id":"93526ba07c637fb3","repo":"facebook/relay","slug":"terser-syntax-is-only-supported-on-non-input-objec","errorCode":null,"errorMessage":"Terser syntax is only supported on non-input objects or interfaces.","messagePattern":"Terser syntax is only supported on non-input objects or interfaces\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-docblock/src/ir.rs","lineNumber":831,"sourceCode":"                name.location,\n            )]);\n        }\n\n        if let Some(type_) = schema.get_type(self.type_.item) {\n            match type_ {\n                Type::Object(object_id) => {\n                    let object = schema.object(object_id);\n                    return Ok(self.object_definitions(object, project_config));\n                }\n                Type::Interface(interface_id) => {\n                    let interface = schema.interface(interface_id);\n                    return Ok(self.interface_definitions(\n                        interface.name,\n                        interface_id,\n                        project_config,\n                    ));\n                }\n                _ => panic!(\"Terser syntax is only supported on non-input objects or interfaces.\"),\n            }\n        }\n\n        let suggester = GraphQLSuggestions::new(schema);\n        Err(vec![Diagnostic::error_with_data(\n            ErrorMessagesWithData::TypeNotFound {\n                type_name: self.type_.item,\n                suggestions: suggester.object_type_suggestions(self.type_.item),\n            },\n            self.type_.location,\n        )])\n    }\n\n    fn location(&self) -> Location {\n        self.location\n    }\n\n    fn root_fragment_name(&self) -> Option<WithLocation<FragmentDefinitionName>> {","sourceCodeStart":813,"sourceCodeEnd":849,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-docblock/src/ir.rs#L813-L849","documentation":"When resolving a type reference in the SchemaDocument, relay-docblock only supports expanding fields on plain object types and interfaces. If the referenced definition is an input object, scalar, union, or enum, it panics with this message; otherwise it would produce a normal TypeNotFound diagnostic.","triggerScenarios":"field_definitions is reached for a type definition that is not an object or interface — e.g. a @argumentDefinitions/@refetchable/fragment type pointing at an input object, enum, union, or scalar while processing the document.","commonSituations":"Using a mutation/input type name where an output object is expected in a fragment type annotation; schema changes turning an object into a union/enum; referencing a scalar type in a fragment's type condition.","solutions":["Check the fragment's @argumentDefinitions/type annotation references an object or interface type, not an input/enum/union.","Compare the referenced type in the latest schema SDL — it may have changed kind; update the fragment accordingly.","Rename the reference to the correct output type that the fragment should spread from.","If the intent is an invalid reference, fix the GraphQL text rather than expecting a friendly diagnostic."],"exampleFix":"// before\nfragment F on SomeInput @refetchable\n// after\nfragment F on SomeObject @refetchable","handlingStrategy":"type-guard","validationCode":"// check the referenced type kind in your schema before relying on docblock expansion\nconst t = schema.getType(typeName);\nif (!t) throw new Error(`Unknown type ${typeName}`);\nif (!['GraphQLObjectType', 'GraphQLInterfaceType'].includes(t.constructor.name)) throw new Error(`${typeName} must be an object or interface`);","typeGuard":"function isExpandableType(t) { return t && (t.kind === 'OBJECT' || t.kind === 'INTERFACE'); }","tryCatchPattern":null,"preventionTips":["Only reference object/interface types in fragment type conditions and @argumentDefinitions","Re-validate fragments after schema changes that alter type kinds","Run relay-compiler in CI to catch invalid references early"],"tags":["graphql","schema","panic","docblock"],"backgroundTag":"invalid-ref-type","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}