<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expect_keyword(lexer: Lexer, value: str) -> Token: """Expect the next token to be a given keyword. If the next token is a given keyword, return that token after advancing the lexer. Otherwise, do not change the parser state and throw an error. """

    token = lexer.token
    if token.kind == TokenKind.NAME and token.value == value:
        lexer.advance()
        return token

    raise GraphQLSyntaxError(
        lexer.source, token.start, f"Expected {value!r}, found {token.desc}"
    )