code: def parse_operation_definition(lexer: Lexer) -> OperationDefinitionNode:
      
      start = lexer.token
      if peek(lexer, TokenKind.BRACE_L):
          return OperationDefinitionNode(
              operation=OperationType.QUERY,
              name=None,
              variable_definitions=[],
              directives=[],
              selection_set=parse_selection_set(lexer),
              loc=loc(lexer, start),
          )
      operation = parse_operation_type(lexer)
      name = parse_name(lexer) if peek(lexer, TokenKind.NAME) else None
      return OperationDefinitionNode(
          operation=operation,
          name=name,
          variable_definitions=parse_variable_definitions(lexer),
          directives=parse_directives(lexer, False),
          selection_set=parse_selection_set(lexer),
          loc=loc(lexer, start),
      )
docs: OperationDefinition