{"record":{"id":"dc11ee256ccc3381","repo":"hasura/graphql-engine","slug":"end-of-file-reached-when-expecting-further-input","errorCode":null,"errorMessage":"end of file reached when expecting further input","messagePattern":"end of file reached when expecting further input","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/lang-graphql/src/lexer.rs","lineNumber":147,"sourceCode":"    line: usize,\n    column: usize,\n}\n\n/// Error when tokenizing the input source\n#[derive(Error, Debug, PartialEq, Eq, Clone)]\npub enum Error {\n    /// An unexpected character was found\n    ///\n    /// Unexpected characters are characters that _do_ exist in the GraphQL\n    /// language, but is not expected at the current position in the document.\n    #[error(\"unexpected character in the document: {0:?}\")]\n    UnexpectedCharacter(char),\n\n    /// The input source was unexpectedly terminated\n    ///\n    /// Emitted when the current token requires a succeeding character, but\n    /// the source has reached EOF. Emitted when scanning e.g. `\"1.\"`.\n    #[error(\"end of file reached when expecting further input\")]\n    UnexpectedEndOfFile,\n\n    /// An invalid string literal was found\n    #[error(\"invalid string literal found: {0:?}\")]\n    InvalidString(string::Error),\n\n    /// An invalid number literal was found\n    #[error(\"invalid number literal found: {0:?}\")]\n    InvalidNumber(number::Error),\n\n    // An invalid graphql name\n    #[error(\"invalid graphql name: {0}\")]\n    InvalidGraphQlName(String),\n}\n\nimpl From<ast::common::InvalidGraphQlName> for Error {\n    fn from(error: ast::common::InvalidGraphQlName) -> Self {\n        Error::InvalidGraphQlName(error.0)","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/lang-graphql/src/lexer.rs#L129-L165","documentation":"The lexer hit end of input while a partially scanned token still requires more characters, e.g. scanning \"1.\" — after the dot a digit must follow but the source ended.","triggerScenarios":"Lexing a document that ends mid-token: \"1.\" at EOF, an unterminated number exponent like \"1e\", or a token whose continuation character is missing at the boundary of the input.","commonSituations":"Truncated queries from HTTP transport or file reads, substring slicing of larger documents, or tests with incomplete fixtures.","solutions":["Check for truncated input at the reported offset (often the very end of the document)","Add the missing trailing characters (e.g. the fractional/exponent digits)","If reading from a stream, ensure the full payload is buffered before parsing"],"exampleFix":"# before\nquery { price(cost: 1.) }   # ends right after '.'\n# after\nquery { price(cost: 1.0) }","handlingStrategy":"validation","validationCode":"if src.ends_with(|c: char| c.is_ascii_digit() || c == '.' || c == '-') {\n    // possibly truncated number token; verify it ends in a complete token\n}","typeGuard":null,"tryCatchPattern":"On UnexpectedEndOfFile, check whether the document was truncated in transit (content-length, checksum) before retrying the parse.","preventionTips":["Buffer the complete request body before parsing","Checksum/validate document length when loading query files"],"tags":["graphql","lexer","eof","truncated-input"],"backgroundTag":"graphql-syntax-error","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}